/* ============================================
   THEMES.CSS - Retro Display Themes
   Green Phosphor | Amber | Apple II HiRes Color | C64 | Game Boy | CGA
   ============================================ */

/* ---- Default Theme: Green Phosphor ---- */
:root,
[data-theme="green"] {
    --bg: #040504;
    --bg-light: #111611;
    --text: #33ff33;
    --text-dim: #1a8c1a;
    --text-bright: #88ff88;
    --accent: #66ff66;
    --accent-dim: #2b9e2b;

    --card-bg: #0d1a0d;
    --card-border: #33ff33;
    --card-red: #33ff33;
    --card-black: #33ff33;

    --glow-color: rgba(51, 255, 51, 0.5);
    --glow-color-strong: rgba(51, 255, 51, 0.8);
    --glow-color-subtle: rgba(51, 255, 51, 0.2);

    --btn-bg: #0d1a0d;
    --btn-bg-hover: #1a331a;
    --btn-border: #33ff33;
    --btn-text: #33ff33;
    --btn-text-hover: #66ff66;

    --chip-gold: #33ff33;
    --chip-silver: #1a8c1a;
    --chip-red: #33ff33;
    --chip-blue: #1a8c1a;

    --danger: #ff3333;
    --success: #66ff66;
    --warning: #33ff33;

    --overlay-bg: rgba(0, 0, 0, 0.85);
    --separator: #1a8c1a;
}

/* ---- Amber / Bernstein Theme ---- */
[data-theme="amber"] {
    --bg: #050400;
    --bg-light: #161200;
    --text: #ffb000;
    --text-dim: #8c6000;
    --text-bright: #ffd060;
    --accent: #ffd966;
    --accent-dim: #b38600;

    --card-bg: #1a1400;
    --card-border: #ffb000;
    --card-red: #ffb000;
    --card-black: #ffb000;

    --glow-color: rgba(255, 176, 0, 0.5);
    --glow-color-strong: rgba(255, 176, 0, 0.8);
    --glow-color-subtle: rgba(255, 176, 0, 0.2);

    --btn-bg: #1a1400;
    --btn-bg-hover: #332800;
    --btn-border: #ffb000;
    --btn-text: #ffb000;
    --btn-text-hover: #ffd966;

    --chip-gold: #ffb000;
    --chip-silver: #8c6000;
    --chip-red: #ffb000;
    --chip-blue: #8c6000;

    --danger: #ff6633;
    --success: #ffd966;
    --warning: #ffb000;

    --overlay-bg: rgba(0, 0, 0, 0.85);
    --separator: #8c6000;
}

/* ---- Apple II HiRes Color Theme ---- */
[data-theme="color"] {
    --bg: #1a1a2e;
    --bg-light: #222240;
    --text: #e0e0e0;
    --text-dim: #888888;
    --text-bright: #ffffff;
    --accent: #ff6600;
    --accent-dim: #cc5200;

    /* Apple II specific palette */
    --apple-green: #14B81A;
    --apple-orange: #FF6600;
    --apple-blue: #0000FF;
    --apple-purple: #FF44FF;
    --apple-white: #FFFFFF;
    --apple-red: #DD0000;
    --apple-yellow: #FFD700;
    --apple-cyan: #00FFFF;

    --card-bg: #2a2a4e;
    --card-border: #e0e0e0;
    --card-red: #DD0000;
    --card-black: #e0e0e0;

    --glow-color: rgba(224, 224, 224, 0.3);
    --glow-color-strong: rgba(224, 224, 224, 0.6);
    --glow-color-subtle: rgba(224, 224, 224, 0.15);

    --btn-bg: #2a2a4e;
    --btn-bg-hover: #3a3a6e;
    --btn-border: #e0e0e0;
    --btn-text: #e0e0e0;
    --btn-text-hover: #ffffff;

    --chip-gold: #FFD700;
    --chip-silver: #C0C0C0;
    --chip-red: #DD0000;
    --chip-blue: #0000FF;

    --danger: #DD0000;
    --success: #14B81A;
    --warning: #FF6600;

    --overlay-bg: rgba(26, 26, 46, 0.9);
    --separator: #888888;
}

/* ---- Commodore 64 ---- */
[data-theme="c64"] {
    --bg: #2a1f66;
    --bg-light: #352879;
    --text: #a59fff;
    --text-dim: #6c5eb5;
    --text-bright: #d6d2ff;
    --accent: #c7c2ff;
    --accent-dim: #7869c4;

    --card-bg: #352879;
    --card-border: #a59fff;
    --card-red: #ff8a8a;
    --card-black: #a59fff;

    --glow-color: rgba(165, 159, 255, 0.45);
    --glow-color-strong: rgba(165, 159, 255, 0.8);
    --glow-color-subtle: rgba(165, 159, 255, 0.2);

    --btn-bg: #352879;
    --btn-bg-hover: #43379a;
    --btn-border: #a59fff;
    --btn-text: #a59fff;
    --btn-text-hover: #d6d2ff;

    --chip-gold: #eeee77;
    --chip-silver: #a59fff;
    --chip-red: #ff8a8a;
    --chip-blue: #6c5eb5;

    --danger: #ff7777;
    --success: #aaff66;
    --warning: #eeee77;

    --overlay-bg: rgba(42, 31, 102, 0.9);
    --separator: #6c5eb5;
}

/* ---- Game Boy (DMG): vier Gruentoene, heller Grund ---- */
[data-theme="gameboy"] {
    --bg: #9bbc0f;
    --bg-light: #8bac0f;
    --text: #0f380f;
    --text-dim: #306230;
    --text-bright: #0f380f;
    --accent: #0f380f;
    --accent-dim: #306230;

    --card-bg: #8bac0f;
    --card-border: #0f380f;
    --card-red: #0f380f;
    --card-black: #0f380f;

    --glow-color: rgba(15, 56, 15, 0.25);
    --glow-color-strong: rgba(15, 56, 15, 0.45);
    --glow-color-subtle: rgba(15, 56, 15, 0.12);

    --btn-bg: #8bac0f;
    --btn-bg-hover: #7a9a0d;
    --btn-border: #0f380f;
    --btn-text: #0f380f;
    --btn-text-hover: #0f380f;

    --chip-gold: #0f380f;
    --chip-silver: #306230;
    --chip-red: #0f380f;
    --chip-blue: #306230;

    /* Kein Rot auf dem Game Boy: Gefahr dunkel, Erfolg mittel */
    --danger: #0f380f;
    --success: #306230;
    --warning: #306230;

    --overlay-bg: rgba(139, 172, 15, 0.92);
    --separator: #306230;
}

/* ---- CGA (Palette 1): Cyan, Magenta, Weiss auf Schwarz ---- */
[data-theme="cga"] {
    --bg: #000000;
    --bg-light: #0b0b14;
    --text: #55ffff;
    --text-dim: #00aaaa;
    --text-bright: #ffffff;
    --accent: #ff55ff;
    --accent-dim: #aa00aa;

    --card-bg: #0b0b14;
    --card-border: #55ffff;
    --card-red: #ff55ff;
    --card-black: #ffffff;

    --glow-color: rgba(85, 255, 255, 0.45);
    --glow-color-strong: rgba(85, 255, 255, 0.8);
    --glow-color-subtle: rgba(85, 255, 255, 0.2);

    --btn-bg: #0b0b14;
    --btn-bg-hover: #142a2a;
    --btn-border: #55ffff;
    --btn-text: #55ffff;
    --btn-text-hover: #ffffff;

    --chip-gold: #ffffff;
    --chip-silver: #55ffff;
    --chip-red: #ff55ff;
    --chip-blue: #00aaaa;

    --danger: #ff55ff;
    --success: #55ffff;
    --warning: #ffffff;

    --overlay-bg: rgba(0, 0, 0, 0.9);
    --separator: #00aaaa;
}

/* ---- Theme Transition ---- */
body,
body * {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Disable transitions during theme switch for snappy change */
body.theme-switching,
body.theme-switching * {
    transition: none !important;
}
