:root {
    --primary: #d4af37;
    --primary-light: #e8c547;
    --primary-dark: #aa8c2c;
    --accent: #8b0000;
    --accent-light: #c41e3a;
    --accent-dark: #5a0a0a;
    --text-primary: #f5f1e8;
    --text-secondary: #c9b8a8;
    --bg-dark: #1a1410;
    --bg-darker: #0f0c0a;
    --surface: #2a2420;
    --surface-light: #3d3632;
    --border: #4a423d;
    --success: #6ba876;
    --warning: #d4af37;
    --danger: #c41e3a;
    --info: #6b9bd1;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.6);
    --shadow-inset: inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

/* Typography Optimization */
html {
    font-size: 16px; /* Base size for desktop */
}

body {
    font-family: 'Segoe UI', 'Roboto', -apple-system, BlinkMacSystemFont, 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-image: url('./images/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: var(--bg-darker);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    background: linear-gradient(135deg, rgba(26, 20, 16, 0.75) 0%, rgba(42, 36, 32, 0.96) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(65px);
    border-radius: 24px;
    box-shadow: var(--shadow-lg), inset 0 1px 1px rgba(255, 255, 255, 0.08);
    padding: 28px;
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(212, 175, 55, 0.15);
}

/* Scrollbar styling */
.container::-webkit-scrollbar {
    width: 8px;
}

.container::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.05);
    border-radius: 4px;
}

.container::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 4px;
}

.container::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 20px;
}

.header-logo {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-bottom: 16px;
    border-radius: 9px;  /* Rounded corners */
}

header h1 {
    font-size: 0.0rem;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* Clue Box */
 .clue-box {
    background: linear-gradient(135deg, #842030 0%, #611313 100%);
    color: var(--primary);
    padding: 22px 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(196, 30, 58, 0.3), var(--shadow-inset);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.clue-label {
    font-size: 1.1rem;
    opacity: 0.85;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(245, 241, 232, 0.8);
}

.clue-value {
    font-size: 2.2rem;
    opacity: 0.9;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--primary);
}

/* Game Stats */
 .game-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    /*background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(139, 0, 0, 0.06) 100%);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: var(--shadow-inset); */
} 

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
    letter-spacing: 1px;
}


/* Main Content */
main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}

/* Input Section */
.input-section {
    display: flex;
    gap: 12px;
    width: 100%;
}

.scent-dropdown {
    flex: 1;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(42, 36, 32, 0.8) 0%, rgba(61, 54, 50, 0.8) 100%);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2.5'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 40px;
}

.scent-dropdown:hover:not(:disabled) {
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
    background: linear-gradient(135deg, rgba(42, 36, 32, 0.9) 0%, rgba(61, 54, 50, 0.9) 100%);
}

.scent-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
}

.scent-dropdown:disabled {
    background: rgba(61, 54, 50, 0.5);
    cursor: not-allowed;
    opacity: 0.5;
}

.scent-dropdown option {
    padding: 12px;
    color: var(--bg-dark);
    background: var(--text-primary);
    font-size: 1rem;
}

/* Buttons */
.btn {
    padding: 14px 24px;
    font-size: 0.95rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: var(--bg-dark);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

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

.btn-primary:disabled {
    background: rgba(212, 175, 55, 0.3);
    color: rgba(245, 241, 232, 0.4);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(139, 0, 0, 0.08) 100%);
    color: var(--primary);
    border: 1.5px solid rgba(212, 175, 55, 0.35);
    flex: 1;
    box-shadow: var(--shadow-inset);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(139, 0, 0, 0.12) 100%);
    border-color: var(--primary);
    color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#guessBtn {
    min-width: 100px;
}

/* Game Message */
.game-message {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    padding: 16px;
    border-radius: 10px;
    min-height: 28px;
    letter-spacing: 0.5px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    line-height: 1.5;
}

.game-message:empty {
    display: none;
}

/* Guess History */
.guess-history {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}

.guess-history::-webkit-scrollbar {
    width: 6px;
}

.guess-history::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.05);
    border-radius: 3px;
}

.guess-history::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.guess-history::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

.guess-item {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0%, rgba(139, 0, 0, 0.04) 100%);
    border-left: 3px solid var(--primary);
    padding: 14px;
    border-radius: 10px;
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(212, 175, 55, 0.15);
    box-shadow: var(--shadow-inset);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.guess-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.item-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.note-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.6px;
}

.note-badge.top {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: var(--bg-dark);
}

.note-badge.middle {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: var(--bg-dark);
}

.note-badge.base {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: var(--bg-dark);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.intensity-badge {
    padding: 6px 12px;
    border-radius: 6px;
    background: linear-gradient(135deg, #6ba876 0%, #5a9467 100%);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.6px;
}

.family-badge {
    padding: 6px 12px;
    border-radius: 6px;
    background: linear-gradient(135deg, #6b9bd1 0%, #5a8bc4 100%);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.6px;
}

.feedback {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    font-size: 0.9rem;
}

.feedback-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(42, 36, 32, 0.6) 0%, rgba(61, 54, 50, 0.6) 100%);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: var(--shadow-inset);
}

.feedback-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.feedback-value {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    margin-bottom: 20px;
}

/* How to Play Section */
.how-to-play {
    display: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal.open {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 20, 16, 0.95) 0%, rgba(42, 36, 32, 0.98) 100%);
    border-radius: 16px;
    box-shadow: var(--shadow-lg), inset 0 1px 1px rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(139, 0, 0, 0.06) 100%);
}

.modal-header h2 {
    color: var(--primary);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--primary-light);
}

.modal-close:focus {
    outline: none;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.modal-body {
    padding: 24px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
}

.modal-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-body li {
    margin-bottom: 16px;
    padding-left: 24px;
    position: relative;
    font-size: 1rem;
}

.modal-body li:before {
    content: "▪";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.modal-body strong {
    color: var(--primary);
    font-weight: 600;
}

.modal-body ul ul {
    margin: 12px 0 0 20px;
    padding: 0;
}

.modal-body ul ul li {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.help-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    letter-spacing: 0.3px;
    margin: 0 0 12px 0;
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    letter-spacing: 0.3px;
    margin: 0;
}

.help-link {
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: underline;
    font-weight: 600;
}

.help-link:hover {
    color: var(--primary-light);
    text-decoration-thickness: 2px;
}

.help-link:active {
    color: var(--primary-dark);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .clue-value {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .scent-dropdown,
    .btn {
        font-size: 0.95rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    body {
        padding: 8px;
    }

    .container {
        padding: 18px;
        border-radius: 16px;
        max-height: calc(100vh - 16px);
    }

    header h1 {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .clue-box {
        padding: 16px 14px;
    }

    .clue-label {
        font-size: 0.95rem;
    }

    .clue-value {
        font-size: 1.8rem;
        font-weight: 700;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .input-section {
        gap: 10px;
    }

    .scent-dropdown {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .scent-dropdown option {
        font-size: 0.9rem;
    }

    .btn {
        padding: 12px 16px;
        font-size: 0.85rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #guessBtn {
        min-width: 80px;
    }

    .game-message {
        font-size: 0.9rem;
        padding: 14px;
    }

    .guess-item {
        padding: 12px;
    }

    .guess-name {
        font-size: 1rem;
    }

    .item-info {
        font-size: 0.85rem;
        gap: 6px;
    }

    .note-badge,
    .intensity-badge,
    .family-badge {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .feedback {
        grid-template-columns: 1fr;
        gap: 6px;
        font-size: 0.85rem;
    }

    .feedback-label {
        font-size: 0.75rem;
    }

    .feedback-value {
        font-size: 0.9rem;
    }

    footer {
        margin-top: 20px;
        padding-top: 16px;
    }

    .copyright {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 18px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 18px;
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .modal-body li {
        font-size: 0.9rem;
        margin-bottom: 14px;
    }

    .modal-body ul ul li {
        font-size: 0.85rem;
    }

    .alert-modal-content {
        padding: 24px 20px;
        max-width: 90%;
    }

    .alert-message {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .alert-modal-content .btn {
        min-width: 120px;
        padding: 12px 20px;
        font-size: 0.9em;
    }
}

@media (max-width: 360px) {
    html {
        font-size: 13px;
    }

    .container {
        padding: 14px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .clue-value {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .feedback {
        grid-template-columns: 1fr;
    }

    .btn {
        font-size: 0.8rem;
        padding: 10px 12px;
    }

    .copyright {
        font-size: 0.75rem;
    }

    .controls {
        margin-top: 18px;
        margin-bottom: 14px;
    }

    footer {
        margin-top: 18px;
        padding-top: 14px;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-body {
        font-size: 0.85rem;
        padding: 16px;
    }
}

/* Alert Modal Styles */
.alert-modal {
    display: flex;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.alert-modal-content {
    background: linear-gradient(135deg, rgba(26, 20, 16, 0.95) 0%, rgba(42, 36, 32, 0.98) 100%);
    border-radius: 16px;
    box-shadow: var(--shadow-lg), inset 0 1px 1px rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 32px 28px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.alert-message {
    color: var(--text-secondary);
    font-size: 1.05em;
    line-height: 1.6;
    margin-bottom: 24px;
    letter-spacing: 0.3px;
}

.alert-modal-content .btn {
    min-width: 140px;
}

@media (max-width: 480px) {
    .alert-modal-content {
        padding: 24px 20px;
        max-width: 90%;
    }

    .alert-message {
        font-size: 0.95em;
        margin-bottom: 20px;
    }

    .alert-modal-content .btn {
        min-width: 120px;
        padding: 12px 20px;
        font-size: 0.9em;
    }
}

/* Enhanced Focus States */
*:focus-visible {
    outline: 3px dashed var(--primary);
    outline-offset: 3px;
}

button:focus-visible,
select:focus-visible,
.help-link:focus-visible {
    outline: 3px dashed var(--primary);
    outline-offset: 3px;
}

.scent-dropdown:focus-visible {
    outline: 3px dashed var(--primary);
    outline-offset: 3px;
    border-color: var(--primary);
}

.modal-close:focus-visible {
    outline: 3px dashed var(--primary);
    outline-offset: 3px;
}

.btn:focus-visible {
    outline: 3px dashed var(--primary);
    outline-offset: 3px;
}
