/* Modernized styles for Imagine Act */
:root {
    /* 🌍 Global Defaults */
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    --radius: 10px;
    --gap: 18px;
    --padding: 18px;
    --max-width: 960px;

    /* 💫 Effects */
    --shadow: rgba(0, 0, 0, 0.4);
    --border-light: rgba(255, 255, 255, 0.03);

    /* 💎 Default (Dark Mode Base) */
    --bg: #121212;
    --surface: #1c1c1c;
    --card: #0b1220;
    --text: #ffffff;
    --accent: #00ffa8;
    --muted: #888;
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.06);
    --error: #ff7b7b;

    /* 🌟 IA Identity */
    --ia-primary: #ff8c00;
    --ia-bg: var(--bg);
    --ia-surface: var(--surface);
    --ia-text: var(--text);
    --ia-accent: var(--accent);
    --ia-shadow: var(--shadow);
}

/* 🌑 Dark Theme */
[data-theme="dark"] {
    --bg: #121212;
    --surface: #1c1c1c;
    --card: #0b1220;
    --text: #ffffff;
    --accent: #00ffa8;
    --muted: #777;
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.06);
    --shadow: rgba(0, 0, 0, 0.4);
      --font-family: 'Roboto Mono', monospace; /* Dark tech vibe */

}

/* 🕹️ Retro Theme */
[data-theme="retro"] {
    --bg: #0d0d0d;
    --surface: #141414;
    --card: #1e0f24;
    --text: #00ffe0;
    --accent: #ff0099;
    --muted: #00aaff;
    --glass: rgba(255, 0, 153, 0.08);
    --glass-border: rgba(255, 0, 153, 0.2);
    --shadow: rgba(255, 0, 153, 0.3);
      --font-family: 'Press Start 2P', 'Courier New', monospace; /* Retro pixel font */

}

/* 🌞 Light Theme */
[data-theme="light"] {
    --bg: #f7f7f7;
    --surface: #ffffff;
    --card: #f9f9f9;
    --text: #1c1c1c;
    --accent: #0078ff;
    --muted: #555;
    --glass: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.05);
    --shadow: rgba(0, 0, 0, 0.15);
      --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* Clean modern font */

}


* {
    box-sizing: border-box
}

html,
body {
    height: 100%;
    margin: 0;
    background: linear-gradient(180deg, #071021 0%, #0f1720 100%);
    color: #e6eef6
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-family);
    transition: background 0.4s ease, color 0.4s ease;
}

.titlebar {
    z-index: 11;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--glass-border)
}

.title h1 {
    font-size: 20px;
    margin: 0
}

.controls {
    display: flex;
    align-items: center;
    gap: 12px
}

.icon {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer
}

.menu {
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 8px;
    border-radius: 8px;
    color: var(--accent);
    cursor: pointer;
}

.menu-panel {
    position: absolute;
    right: 18px;
    top: 68px;
    background: var(--card);
    padding: 12px;
    border-radius: 8px;
    min-width: 220px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(3, 7, 18, 0.6)
}

.menu-panel-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 320px;
}

.menu-select {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.menu-button {
    background: var(--ia-surface);
    color: var(--ia-accent);
    border: 2px solid var(--ia-accent);
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    padding: 10px 18px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    cursor: pointer;
    box-shadow:
        inset 0 -3px 6px var(--ia-shadow),
        0 4px 10px rgba(0, 0, 0, 0.4),
        0 0 10px color-mix(in srgb, var(--ia-accent) 40%, transparent);
    transition: all 0.25s ease;
}

.menu-button:hover {
    color: var(--ia-text);
    background: var(--ia-accent);
    box-shadow:
        0 0 15px color-mix(in srgb, var(--ia-accent) 70%, transparent),
        0 6px 20px rgba(0, 0, 0, 0.6);
    transform: translateY(-3px);
}

.menu-button:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 2px 4px var(--ia-shadow),
        0 2px 6px rgba(0, 0, 0, 0.4);
}

.menu-button:focus {
    outline: none;
    box-shadow: 0 0 12px color-mix(in srgb, var(--ia-accent) 80%, transparent);
}

#themeSelect,
#languageSelect {
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 6px 10px;
    font-family: var(--font-family);
    text-transform: uppercase;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.25s ease;
}

#notifications {
    height: 40px;
}

#themeSelect:hover,
#languageSelect:hover {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 15px var(--accent);
}

.layout {
    max-width: var(--max-width);
    margin: 28px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    padding: var(--padding);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    box-shadow: 0 3px 12px var(--shadow);
}

.login .form {
    display: grid;
    gap: 10px;
    max-width: 420px
}

input {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: inherit;
    width: 100%;
}

.primary {
    background: linear-gradient(90deg, var(--accent), #00ffa8);
    color: var(--bg);
    border: none;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--shadow);
}

.hint {
    color: var(--muted);
    font-size: 13px;
    margin-top: 10px
}

.balanceRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px
}

.balance {
    font-weight: 700;
    font-size: 28px;
    color: var(--accent)
}

.speech-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
    min-width: 220px;
}

/* Fix text height so mic stays still */
#recognizedText {
    min-height: 1.8em;
    max-height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    transition: color 0.3s ease;
}

.glow {
    border: 2px solid var(--accent);
    border-radius: 50%;
    padding: 0;
    width: 80px;
    height: 80px;
    font-size: 30px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-bars {
    display: flex;
    gap: 6px
}

.bar {
    width: 8px;
    height: 6px;
    background: var(--border-light);
    border-radius: 4px;
    transition: all 140ms ease
}

/* Mic active/inactive states */
#micBtn.active {
    animation: pulseMic 1.4s infinite;
}

@keyframes pulseMic {
    0% {
        box-shadow: 0 0 10px var(--accent);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 25px var(--accent);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 10px var(--accent);
        transform: scale(1);
    }
}

.purchase-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
    max-height: 320px;
    overflow: auto;
}

.purchase-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    border: 1px dashed var(--border-light);
    margin-bottom: 8px;
}

.purchase-item .item-name {
    width: 80%;
}

.purchase-item .item-amount {
    width: 15%;
}

.purchase-item .remove {
    background: transparent;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 18px;
    width: 5%;
    min-width: 50px;
}

.total {
    font-weight: 700;
    margin-top: 8px
}

.footer {
    max-width: var(--max-width);
    margin: 20px auto;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 8px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

@media (max-width:680px) {
    .balanceRow {
        flex-direction: column;
        align-items: stretch
    }
}

#aboutGameModal {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    background: var(--bg);
    padding: 20px 14px;
    border-radius: 12px;
    box-shadow: 2px 2px 12px var(--accent);
}

#aboutGameModal .modal-content {
  color: #fff;
  border-radius: 12px;
  position: relative;
}

#aboutGameModal .btn-close-about {
    background: transparent;
    position: absolute;
    top: 20px;
    right: 20px;
}

#aboutGameModal .modal-header {
  border-bottom: none;
  font-size: 26px;
}

#aboutGameModal .modal-title {
  color: #f7dc6f; /* yellow-400 */
}

#aboutGameModal h3 {
  color: #3498db; /* blue-400 */
  margin-top: 1rem;
  font-size: 1.1rem;
}

#aboutGameModal p, #aboutGameModal li {
  font-size: 0.95rem;
  line-height: 1.6;
}

#aboutGameModal ul, #aboutGameModal ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

#aboutGameModal strong {
  color: #f1c40f; /* highlight key terms */
}

#aboutGameModal .modal-footer {
  border-top: none;
}