* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    width: 100%;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    max-width: 900px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.game-area {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
}

.left-panel, .game-board, .right-panel {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.left-panel {
    flex: 1;
    min-width: 300px;
}

.game-board {
    flex: 2;
    min-width: 500px;
}

.right-panel {
    flex: 1;
    min-width: 300px;
}

h2 {
    font-size: 1.8rem;
    color: #1a2980;
    margin-bottom: 20px;
    border-bottom: 3px solid #26d0ce;
    padding-bottom: 10px;
}

.instructions {
    background-color: #f0f8ff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 5px solid #1a2980;
}

.instructions h3 {
    color: #1a2980;
    margin-bottom: 10px;
}

.instructions ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.settings {
    margin-bottom: 25px;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #1a2980;
}

.setting-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #26d0ce;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

.setting-group select:focus {
    outline: none;
    border-color: #1a2980;
}

.number-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    min-height: 100px;
}

.number-item {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e3f2fd;
    border: 3px solid #1a2980;
    border-radius: 10px;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    cursor: grab;
    user-select: none;
    transition: all 0.2s ease;
    color: #1a2980;
}

.number-item:hover {
    background-color: #bbdefb;
    transform: scale(1.05);
}

.number-item.dragging {
    opacity: 0.7;
    transform: scale(0.95);
}

.number-item.used {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #999;
}

.game-info {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a2980;
    font-family: 'Roboto Mono', monospace;
}

.grid-container {
    position: relative;
    margin-bottom: 30px;
}

.game-grid {
    display: grid;
    gap: 5px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.grid-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border: 3px solid #1a2980;
    border-radius: 8px;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: #1a2980;
    transition: all 0.2s ease;
}

.grid-cell.empty {
    background-color: #e8f5e9;
    border-color: #4caf50;
}

.grid-cell.hovered {
    background-color: #e1f5fe;
    border-color: #0288d1;
    transform: scale(1.05);
}

.grid-cell.correct {
    background-color: #e8f5e9;
    border-color: #4caf50;
}

.grid-cell.incorrect {
    border-color: #f44336;
    background-color: #ffebee;
}

.grid-cell.clue {
    background-color: #fff3e0;
    border-color: #ff9800;
    font-weight: 800;
}

.row-clue, .col-clue {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3e5f5;
    border-radius: 8px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: #7b1fa2;
    padding: 10px;
    min-width: 80px;
    text-align: center;
}

.row-clue {
    margin-top: 5px;
}

.col-clue {
    margin-left: 5px;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background-color: #1a2980;
    color: white;
}

.btn-primary:hover {
    background-color: #0d1a6b;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: #26d0ce;
    color: white;
}

.btn-secondary:hover {
    background-color: #1cb2b0;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.score-board {
    background-color: #e8f5e9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.score-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.score-item {
    text-align: center;
}

.score-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a2980;
    font-family: 'Roboto Mono', monospace;
}

.score-label {
    font-size: 1rem;
    color: #555;
}

.progress-container {
    margin-top: 20px;
}

.progress-bar {
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #26d0ce, #1a2980);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #666;
}

.sequence-info {
    background-color: #f0f4ff;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.sequence-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.seq-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.seq-tab.active {
    color: #1a2980;
    border-bottom: 3px solid #1a2980;
}

.seq-content {
    display: none;
}

.seq-content.active {
    display: block;
}

.seq-content h3 {
    color: #1a2980;
    margin-bottom: 10px;
}

.seq-content p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.example-box {
    background-color: #e1f5fe;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.example-box h4 {
    color: #0277bd;
    margin-bottom: 10px;
}

.history-box {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    min-height: 150px;
    max-height: 200px;
    overflow-y: auto;
}

.history-box p {
    margin-bottom: 10px;
    line-height: 1.4;
    font-size: 0.9rem;
}

.win-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: white;
    text-align: center;
}

.win-content {
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.win-content h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 20px;
    border-bottom: 3px solid white;
}

.win-content p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.win-stats {
    display: flex;
    justify-content: space-around;
    margin: 25px 0;
}

.win-stats div {
    text-align: center;
}

.win-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.win-label {
    font-size: 1rem;
    opacity: 0.9;
}

.solution-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    color: #1a2980;
    margin-bottom: 20px;
}

.solution-grid {
    display: grid;
    gap: 5px;
    margin: 20px auto;
    max-width: 400px;
}

.solution-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e8f5e9;
    border: 2px solid #4caf50;
    border-radius: 5px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: #1a2980;
}

.footer {
    text-align: center;
    margin-top: 30px;
    color: white;
    padding: 20px;
    width: 100%;
    opacity: 0.8;
}

@media (max-width: 1200px) {
    .game-area {
        flex-direction: column;
    }
    
    .left-panel, .game-board, .right-panel {
        width: 100%;
    }
    
    .game-board {
        min-width: auto;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2.2rem;
    }
    
    .game-grid {
        max-width: 350px;
    }
    
    .grid-cell {
        font-size: 1.5rem;
    }
    
    .number-item {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
}