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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

.container {
    max-width: 950px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    margin-bottom: 5px;
}

.subtitle {
    color: #a0a0a0;
    font-style: italic;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.size-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

select {
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid #00d4ff;
    border-radius: 8px;
    background: #1a1a2e;
    color: #e0e0e0;
    cursor: pointer;
}

select:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #1a1a2e;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.top-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.btn-solve {
    background: linear-gradient(135deg, #00ff64, #00cc50);
    color: #1a1a2e;
}

.btn-solve:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 100, 0.4);
}

.btn-hint {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: #1a1a2e;
}

.btn-hint:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 204, 0, 0.4);
}

.btn-reset {
    background: transparent;
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
}

.btn-reset:hover {
    background: rgba(255, 107, 107, 0.1);
}

.game-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 15px;
}

.attempts {
    font-size: 1.2rem;
}

.attempts-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b6b;
}

.status {
    font-size: 1.1rem;
    padding: 10px 20px;
    border-radius: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.status.success {
    background: rgba(0, 255, 100, 0.2);
    color: #00ff64;
}

.status.error {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.status.info {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
}

.metrics-panel {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.metric {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.metric-label {
    color: #a0a0a0;
    font-size: 0.85rem;
}

.metric-value {
    color: #00d4ff;
    font-weight: bold;
    font-size: 1.1rem;
    margin-left: 5px;
}

.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    overflow: auto;
}

.board {
    display: grid;
    gap: 2px;
    background: #0a0a15;
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cell:hover:not(.fixed) {
    background: rgba(0, 212, 255, 0.2);
}

.cell.selected {
    background: rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}

.cell.fixed {
    cursor: default;
    color: #00d4ff;
}

.cell.error {
    animation: shake 0.5s ease;
    background: rgba(255, 107, 107, 0.3);
}

.cell.solved {
    background: rgba(0, 255, 100, 0.2);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.number-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto 30px;
}

.number-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #00d4ff;
    background: transparent;
    color: #00d4ff;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.number-btn:hover {
    background: rgba(0, 212, 255, 0.2);
}

.number-btn.clear-btn {
    width: auto;
    padding: 0 15px;
    font-size: 0.9rem;
}

.solver-metrics {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 100, 0.3);
    margin-bottom: 20px;
}

.solver-metrics h3 {
    color: #00ff64;
    margin-bottom: 15px;
    text-align: center;
}

.solver-metrics .metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.solver-metrics .solver-metric {
    background: rgba(0, 255, 100, 0.1);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.solver-metrics .solver-metric .label {
    color: #a0a0a0;
    font-size: 0.85rem;
}

.solver-metrics .solver-metric .value {
    color: #00ff64;
    font-size: 1.3rem;
    font-weight: bold;
}

.ghedn-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.ghedn-info h3 {
    color: #00d4ff;
    margin-bottom: 10px;
    text-align: center;
}

.ghedn-info ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.ghedn-info li {
    color: #a0a0a0;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .controls, .top-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
        width: 100%;
    }

    .metrics-panel {
        gap: 10px;
    }
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    color: #a0a0a0;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 8px;
}

footer a {
    color: #00d4ff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

footer a:hover {
    text-decoration: underline;
}

footer svg {
    vertical-align: middle;
}