* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 50%, #d9e2ec 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    user-select: none;
}

.app-container {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

header {
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.8em;
    font-weight: 800;
    background: linear-gradient(135deg, #e63946 0%, #f4a261 50%, #2a9d8f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header .subtitle {
    color: #5a6c7d;
    font-size: 1em;
    margin-top: 5px;
}

header .subtitle a {
    color: #2a9d8f;
    text-decoration: none;
}

header .subtitle a:hover {
    text-decoration: underline;
}

/* Note Display */
.note-display {
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.current-note {
    font-size: 3.5em;
    font-weight: 800;
    background: linear-gradient(135deg, #e63946 0%, #f4a261 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: note-pop 0.15s ease;
}

@keyframes note-pop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* Genie Section */
.genie-section {
    margin-bottom: 25px;
}

.genie-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.genie-btn {
    width: 60px;
    height: 80px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 1.5em;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

/* Soft gradient buttons */
.genie-btn[data-btn="1"] {
    background: linear-gradient(180deg, #e63946 0%, #d62839 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}
.genie-btn[data-btn="2"] {
    background: linear-gradient(180deg, #f4a261 0%, #e8975a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 162, 97, 0.3);
}
.genie-btn[data-btn="3"] {
    background: linear-gradient(180deg, #e9c46a 0%, #ddb85f 100%);
    color: #264653;
    box-shadow: 0 4px 12px rgba(233, 196, 106, 0.3);
}
.genie-btn[data-btn="4"] {
    background: linear-gradient(180deg, #2a9d8f 0%, #248a7e 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.3);
}
.genie-btn[data-btn="5"] {
    background: linear-gradient(180deg, #48cae4 0%, #3db8d1 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 202, 228, 0.3);
}
.genie-btn[data-btn="6"] {
    background: linear-gradient(180deg, #4895ef 0%, #3d85db 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 149, 239, 0.3);
}
.genie-btn[data-btn="7"] {
    background: linear-gradient(180deg, #7b2cbf 0%, #6a24a8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(123, 44, 191, 0.3);
}
.genie-btn[data-btn="8"] {
    background: linear-gradient(180deg, #e63988 0%, #d62d78 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(230, 57, 136, 0.3);
}

.genie-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.genie-btn:active,
.genie-btn.active {
    transform: translateY(3px);
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.genie-hint {
    color: #7a8a9a;
    font-size: 0.85em;
}

/* Controls */
.control-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    margin-bottom: 10px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-row label {
    color: #5a6c7d;
    font-size: 0.85em;
}

.control-row input[type="range"] {
    width: 100px;
    accent-color: #e63946;
}

.control-row span {
    color: #e63946;
    font-weight: 700;
    min-width: 28px;
}

.reset-btn {
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 20px;
    color: #5a6c7d;
    font-family: inherit;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: rgba(230, 57, 70, 0.1);
    border-color: rgba(230, 57, 70, 0.3);
    color: #e63946;
}

/* Status */
.status {
    color: #7a8a9a;
    font-size: 0.8em;
    margin-bottom: 20px;
}

/* Technical Section */
.tech-section {
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    text-align: left;
}

.tech-section h3 {
    font-size: 1.3em;
    font-weight: 700;
    color: #264653;
    margin-bottom: 20px;
    text-align: center;
}

.tech-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tech-block h4 {
    font-size: 1em;
    font-weight: 700;
    color: #2a9d8f;
    margin-bottom: 8px;
}

.tech-block p {
    font-size: 0.9em;
    line-height: 1.6;
    color: #4a5568;
}

.tech-block a {
    color: #2a9d8f;
    text-decoration: none;
}

.tech-block a:hover {
    text-decoration: underline;
}

.tech-block code {
    background: rgba(42, 157, 143, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #264653;
}

.tech-block strong {
    color: #264653;
}

.tech-block em {
    color: #e63946;
    font-style: normal;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.97);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay.hidden { display: none; }

.overlay-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.overlay-content h2 {
    font-size: 3em;
    font-weight: 800;
    background: linear-gradient(135deg, #e63946 0%, #f4a261 50%, #2a9d8f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.overlay-content p {
    color: #5a6c7d;
    font-size: 1.1em;
    margin-bottom: 25px;
}

.loading {
    margin: 30px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #e63946;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: #7a8a9a;
    font-size: 0.95em;
}

.start-btn {
    padding: 15px 50px;
    font-size: 1.2em;
    font-weight: 700;
    font-family: inherit;
    background: linear-gradient(135deg, #e63946 0%, #f4a261 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.3);
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(230, 57, 70, 0.4);
}

/* Responsive */
@media (max-width: 500px) {
    header h1 { font-size: 2.2em; }
    .current-note { font-size: 2.8em; }
    .genie-btn { width: 42px; height: 60px; font-size: 1.2em; }
    .genie-buttons { gap: 5px; }
    .control-section { flex-direction: column; gap: 10px; }
    .tech-section { padding: 18px; }
    .tech-block p { font-size: 0.85em; }
}
