/* ============================================
   TUNIVERSO - BASE STYLES
   ============================================ */

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

body {
    background-color: #000000;
    color: #FFD700;
    font-family: Monaco, Consolas, 'Courier New', monospace;
    min-height: 100dvh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
    scrollbar-width: thin;
    scrollbar-color: #FFD700 #000000;
}

body::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track {
    background: #000000;
}

body::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 6px;
}

body::-webkit-scrollbar-thumb:hover {
    background: #FFC700;
}

.container {
    width: 100%;
    max-width: min(800px, 95vw);
    padding: 0 clamp(0.25rem, 1vw, 0.75rem);
}

/* ============================================
   HEADER
   ============================================ */

header {
    text-align: center;
    margin-bottom: 1.618rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.618rem;
}

h1 {
    font-size: clamp(1.25rem, 4vw, 2rem);
    font-weight: bold;
    letter-spacing: 2px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

#tuner-canvas {
    width: 100%;
    max-width: 550px;
    height: auto;
    aspect-ratio: 2 / 1;
}

/* ============================================
   CONTROLS
   ============================================ */

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.config-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.config-group label {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-primary {
    background-color: #FFD700;
    color: #000000;
    border: none;
    padding: 0.75rem 2rem;
    font-family: Monaco, Consolas, 'Courier New', monospace;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

.btn-primary:hover {
    background-color: #FFC700;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background-color: #666;
    color: #333;
    cursor: not-allowed;
}

.btn-primary.active {
    background-color: #FF4444;
    color: #FFFFFF;
}

.btn-info {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid #FFD700;
    color: #FFD700;
    font-family: Monaco, Consolas, 'Courier New', monospace;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-info:hover {
    background-color: #FFD700;
    color: #000000;
}


.btn-donate {
    background-color: #FFD700;
    color: #000000;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: Monaco, Consolas, 'Courier New', monospace;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.btn-donate:hover {
    background-color: #FFC700;
    transform: translateY(-1px);
}

/* ============================================
   FORM INPUTS
   ============================================ */

select, input[type="number"] {
    background-color: #1a1a1a;
    color: #FFD700;
    border: 1px solid #FFD700;
    padding: 0.5rem;
    font-family: Monaco, Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    border-radius: 4px;
}

select:focus, input[type="number"]:focus {
    outline: none;
    border-color: #FFC700;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.error {
    background-color: #FF4444;
    color: #FFFFFF;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    max-width: 600px;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 479px) {
    .container {
        padding: 0.5rem;
    }

    h1 {
        letter-spacing: 1px;
    }
}

@media (max-width: 768px) {
    .controls {
        width: 100%;
    }

    .config-group {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary {
        width: 100%;
        min-height: 44px;
    }

    select, input[type="number"] {
        width: 100%;
    }

    header {
        gap: 1.618rem;
        margin-bottom: 1.618rem;
    }

    header h1 {
        width: 100%;
        font-size: clamp(1.75rem, 6vw, 2.5rem);
        letter-spacing: clamp(0.5rem, 2vw, 1rem);
    }

    main {
        gap: 1rem;
    }

    .controls {
        gap: 1rem;
    }

    .btn-info {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    #tuner-canvas {
        max-height: 60vh;
        aspect-ratio: 2.5 / 1;
    }

    main {
        gap: 1rem;
    }
}

/* ============================================
   RESPONSIVE - DESKTOP
   ============================================ */

@media (min-width: 769px) {
    .controls {
        flex-direction: row;
        justify-content: center;
    }

    header h1 {
        width: fit-content;
        min-width: 450px;
        font-size: clamp(1.5rem, 4vw, 2.25rem);
        letter-spacing: 1.2rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 1601px) {
    .container {
        max-width: 1000px;
    }

    #tuner-canvas {
        max-width: 900px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .btn-primary,
    .btn-donate {
        transition: none;
    }

    .btn-primary:hover,
    .btn-donate:hover {
        transform: none;
    }
}

@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #FFD700;
    }

    #tuner-canvas {
        outline: 2px solid #FFD700;
    }
}
