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

:root {
    /* Food Loop 1988 Palette */
    --bg-dark: #2d1f1a;
    --bg-medium: #3d2a1f;
    --bg-light: #4a3728;
    --bg-warm: #5c4333;

    /* Brand colors - Food Lion inspired */
    --brand-blue: #1e3a5f;
    --brand-yellow: #f4c430;
    --brand-orange: #d4702a;
    --brand-cream: #f5e6c8;
    --brand-brown: #5c4333;

    /* Accent colors */
    --accent-green: #5a9c5a;
    --accent-gold: #d4a026;
    --accent-red: #c44536;
    --accent-teal: #3a7d7d;

    /* Text */
    --text-primary: #f5e6c8;
    --text-secondary: #b8a082;
    --text-muted: #8a7560;

    /* Cards/panels */
    --card-bg: #3d2a1f;
    --card-border: #5c4333;
    --card-hover: #4a3728;

    /* Receipt */
    --receipt-bg: #f5f0e6;
    --receipt-text: #2d1f1a;

    /* Perk card */
    --perk-bg: linear-gradient(145deg, #f4c430 0%, #d4a026 100%);
    --perk-border: #b8860b;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

#game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
}

/* ==================== HEADER ==================== */
#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: linear-gradient(180deg, var(--brand-blue) 0%, #152a45 100%);
    border-bottom: 3px solid var(--brand-yellow);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-img {
    height: 40px;
    width: 40px;
    object-fit: contain;
}

.logo-symbol {
    font-size: 2rem;
    color: var(--brand-yellow);
    font-weight: bold;
}

.logo-title {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--brand-yellow);
    letter-spacing: 2px;
}

.logo-supermarket {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 6px;
    margin-top: 2px;
}

.logo-tagline {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-secondary);
}

.grand-opening {
    background: var(--brand-yellow);
    color: var(--brand-blue);
    padding: 4px 12px;
    border-radius: 2px;
    text-align: center;
    font-weight: 700;
}

.banner-text {
    font-size: 0.7rem;
    display: block;
}

.banner-date {
    font-size: 0.65rem;
    opacity: 0.8;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.family-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 20px;
}

#family-emoji {
    font-size: 1.3rem;
}

#family-name {
    font-weight: 600;
    color: var(--text-primary);
}

.round-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.round-info .value {
    color: var(--brand-yellow);
    font-weight: 600;
}

.round-info .separator {
    color: var(--text-muted);
}

.time-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.3);
    padding: 6px 12px;
    border-radius: 6px;
}

.weather-icon {
    font-size: 1.1rem;
}

.game-time {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.budget-display, .cart-total-display, .remaining-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    min-width: 75px;
}

.budget-display .label, .cart-total-display .label, .remaining-display .label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.budget-display .value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand-yellow);
}

.cart-total-display .value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.remaining-display .value {
    font-size: 1rem;
    font-weight: 700;
}

.remaining-display .value.good { color: var(--accent-green); }
.remaining-display .value.warning { color: var(--brand-orange); }
.remaining-display .value.danger { color: var(--accent-red); }

.combat-loss-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 12px;
    background: rgba(180, 0, 0, 0.3);
    border-radius: 6px;
    min-width: 75px;
    border: 1px solid var(--accent-red);
}

.combat-loss-display .label {
    font-size: 0.65rem;
    color: var(--accent-red);
    text-transform: uppercase;
}

.combat-loss-display .value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-red);
}

.flop-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(145deg, var(--brand-yellow), var(--accent-gold));
    border: 2px solid var(--perk-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flop-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(244, 196, 48, 0.4);
}

.flop-icon {
    font-size: 1.2rem;
}

.karma-display {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-blue);
}

/* ==================== MAIN GAME AREA ==================== */
#game-main {
    display: grid;
    grid-template-columns: 220px 1fr 260px;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

/* ==================== LIST PANEL ==================== */
#list-panel {
    background: var(--bg-medium);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--card-border);
    background: var(--bg-light);
    flex-shrink: 0;
}

.panel-header h2 {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.list-progress {
    background: var(--bg-warm);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

#list-complete { color: var(--accent-green); }

#shopping-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--bg-light);
    border-radius: 6px;
    border-left: 3px solid var(--text-muted);
    transition: all 0.2s ease;
}

.list-item.complete {
    border-left-color: var(--accent-green);
    opacity: 0.6;
}

.list-item.complete .list-item-name {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.list-item-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.list-item.complete .list-item-check {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.list-item-info { flex: 1; }
.list-item-name { font-weight: 500; font-size: 0.85rem; }
.list-item-category { font-size: 0.7rem; color: var(--text-secondary); }

#family-note {
    padding: 12px 15px;
    background: var(--bg-warm);
    border-top: 1px solid var(--card-border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ==================== RAIN WINDOW ==================== */
#rain-window {
    padding: 15px;
    margin-top: auto;
}

.window-frame {
    width: 100%;
    background: linear-gradient(180deg, #5c4333 0%, #4a3728 100%);
    border-radius: 4px;
    padding: 6px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 4px 8px rgba(0,0,0,0.4);
}

.window-pane {
    background: #1a2a3a;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    height: 80px;
    border: 2px solid #3d2a1f;
}

.rain-scene {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.rain-sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        #2a3a4a 0%,
        #3a4a5a 40%,
        #4a5a6a 100%);
    transition: background 5s ease;
}

.rain-treeline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25px;
    z-index: 1;
    opacity: 0.4;
    filter: blur(1px);
    background:
        radial-gradient(ellipse 8px 12px at 5% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 10px 16px at 12% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 6px 10px at 18% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 12px 18px at 28% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 7px 11px at 35% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 9px 14px at 42% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 11px 17px at 52% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 6px 9px at 58% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 10px 15px at 67% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 8px 13px at 75% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 12px 18px at 85% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 7px 11px at 93% 100%, #1a2520 70%, transparent 70%);
}

.rain-drops {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

/* Snow */
.snow-flakes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 2s ease;
}

.snowflake {
    position: absolute;
    color: #fff;
    font-size: 10px;
    text-shadow: 0 0 3px rgba(255,255,255,0.8);
    opacity: 0.8;
    pointer-events: none;
}

.snow-pileup {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.95) 0%,
        rgba(240,245,255,0.98) 50%,
        rgba(220,230,245,1) 100%);
    z-index: 2;
    transition: height 3s ease;
    border-top: 2px solid rgba(200,210,230,0.5);
    box-shadow: 0 -5px 15px rgba(255,255,255,0.3);
}

.window-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scaleX(-1);
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

.window-text-line {
    color: rgba(90, 85, 60, 0.5);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 2px;
    white-space: nowrap;
}

.window-text-line.small {
    font-size: 0.45rem;
    letter-spacing: 1px;
    margin-top: 2px;
    font-weight: 600;
}

.rain-stars {
    position: absolute;
    top: -20%;
    left: -10%;
    width: 120%;
    height: 140%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 5s ease, transform 1s ease;
}

.rain-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: star-twinkle 2s ease-in-out infinite;
}

.rain-star.small {
    width: 1px;
    height: 1px;
    opacity: 0.6;
}

.rain-star.bright {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 3px white;
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.rain-drop {
    position: absolute;
    width: 1px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(200, 220, 255, 0.3) 50%,
        rgba(200, 220, 255, 0.6) 100%);
    animation: rain-fall linear infinite;
}

@keyframes rain-fall {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100px);
        opacity: 0;
    }
}

.window-sill {
    height: 8px;
    background: linear-gradient(180deg, #6d5444 0%, #5c4333 100%);
    border-radius: 0 0 2px 2px;
    margin-top: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Make small window clickable */
#rain-window {
    cursor: pointer;
}

#rain-window:hover .window-frame {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.15),
        0 4px 12px rgba(0,0,0,0.5),
        0 0 20px rgba(244, 196, 48, 0.2);
}

/* ==================== EXPANDED WINDOW ==================== */
.window-expanded-content {
    padding: 20px;
    background: transparent;
}

.window-expanded-frame {
    background: linear-gradient(180deg, #5c4333 0%, #4a3728 100%);
    border-radius: 6px;
    padding: 10px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.1),
        0 6px 20px rgba(0,0,0,0.5);
}

.window-expanded-pane {
    background: #1a2a3a;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    width: 550px;
    height: 200px;
    border: 4px solid #3d2a1f;
}

.window-expanded-scene {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.expanded-sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #2a3a4a 0%, #3a4a5a 40%, #4a5a6a 100%);
    transition: background 2s ease;
}

/* Treeline scaled 2.5x from small window (same positions) */
.expanded-treeline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    z-index: 1;
    opacity: 0.4;
    filter: blur(2px);
    background:
        radial-gradient(ellipse 20px 30px at 5% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 25px 40px at 12% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 15px 25px at 18% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 30px 45px at 28% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 18px 28px at 35% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 22px 35px at 42% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 28px 42px at 52% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 15px 22px at 58% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 25px 38px at 67% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 20px 32px at 75% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 30px 45px at 85% 100%, #1a2520 70%, transparent 70%),
        radial-gradient(ellipse 22px 35px at 93% 100%, #1a2520 70%, transparent 70%);
}

.expanded-stars {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease;
}

.expanded-drops {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

.expanded-drops .rain-drop {
    animation: expanded-rain-fall linear infinite;
}

@keyframes expanded-rain-fall {
    0% {
        transform: translateY(-15px);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateY(215px);
        opacity: 0;
    }
}

.window-expanded-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scaleX(-1);
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

.window-expanded-text .window-text-line {
    color: rgba(90, 85, 60, 0.5);
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: 5px;
    white-space: nowrap;
}

.window-expanded-text .window-text-line.small {
    font-size: 1.1rem;
    letter-spacing: 2.5px;
    margin-top: 5px;
    font-weight: 600;
}

.window-expanded-sill {
    height: 12px;
    background: linear-gradient(180deg, #6d5444 0%, #5c4333 100%);
    border-radius: 0 0 3px 3px;
    margin-top: 6px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.window-time-display {
    text-align: center;
    margin-top: 15px;
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

/* Expanded Snow */
.expanded-snow-flakes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 2s ease;
}

.expanded-snow-pileup {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.95) 0%,
        rgba(240,245,255,0.98) 50%,
        rgba(220,230,245,1) 100%);
    z-index: 2;
    transition: height 3s ease;
    border-top: 3px solid rgba(200,210,230,0.5);
}

/* ==================== STORE AREA ==================== */
#store-area {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-dark);
    position: relative;
}

#store-header {
    padding: 0;
    background: var(--bg-medium);
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.aisle-sign {
    background: var(--brand-orange);
    color: white;
    padding: 8px 20px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
}

.category-tabs {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    padding: 8px 10px;
}

.category-tab {
    padding: 8px 14px;
    background: var(--bg-light);
    border: none;
    border-radius: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid var(--card-border);
}

.category-tab:last-child { border-right: none; }

.category-tab:hover {
    background: var(--bg-warm);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--brand-yellow);
    color: var(--brand-blue);
    font-weight: 700;
}

#store-shelves {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    align-content: start;
}

/* ==================== STORE ITEMS ==================== */
.store-item {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 8px;
    padding: 10px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.store-item:hover {
    border-color: var(--brand-yellow);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.store-item.in-cart {
    border-color: var(--accent-green);
    background: rgba(90, 156, 90, 0.15);
}

.store-item.needed {
    box-shadow: 0 0 0 2px var(--brand-yellow), 0 0 12px rgba(244, 196, 48, 0.3);
}

.item-emoji { font-size: 2.2rem; margin-bottom: 6px; }
.item-name { font-weight: 600; font-size: 0.8rem; margin-bottom: 2px; color: var(--text-primary); }
.item-brand { font-size: 0.65rem; color: var(--text-muted); margin-bottom: 6px; }

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

.item-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent-green);
    background: var(--bg-dark);
    padding: 2px 8px;
    border-radius: 4px;
}

.item-quality {
    font-size: 0.75rem;
    color: var(--accent-gold);
}

/* Item Buttons */
.item-buttons {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    width: 100%;
}

.item-btn {
    flex: 1;
    padding: 5px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
}

.item-btn.buy-btn {
    background: var(--accent-green);
    color: white;
}

.item-btn.buy-btn:hover {
    background: #6aac6a;
    transform: translateY(-1px);
}

.item-btn.flop-btn {
    background: linear-gradient(180deg, var(--brand-yellow) 0%, var(--brand-orange) 100%);
    color: #2d1f1a;
}

.item-btn.flop-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(244, 196, 48, 0.4);
}

.item-btn.take-btn {
    background: linear-gradient(180deg, gold 0%, #daa520 100%);
    color: #2d1f1a;
    font-size: 0.8rem;
}

.item-btn.take-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

.item-btn.in-cart-btn {
    background: var(--bg-light);
    color: var(--accent-green);
    cursor: pointer;
    transition: all 0.15s ease;
}

.item-btn.in-cart-btn:hover {
    background: var(--accent-red);
    color: white;
    transform: translateY(-1px);
}

/* Wounded Items */
.store-item.wounded {
    border-color: var(--accent-red);
    background: rgba(196, 69, 54, 0.1);
}

.store-item.wounded .item-brand {
    color: var(--accent-red);
}

/* In-cart items should always stay green, even if wounded/free */
.store-item.in-cart.wounded,
.store-item.in-cart.free,
.store-item.in-cart {
    border-color: var(--accent-green) !important;
    background: rgba(90, 156, 90, 0.15) !important;
    box-shadow: none !important;
}

.store-item.in-cart .item-brand {
    color: var(--accent-green);
}

.store-item.in-cart .wounded-price {
    color: var(--accent-green);
}

.store-item.free {
    border-color: gold;
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.item-price .original-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 4px;
}

.item-price .wounded-price {
    color: var(--accent-red);
}

.item-price .free-price {
    color: gold;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

/* ==================== CART PANEL ==================== */
#cart-panel {
    background: var(--bg-medium);
    border-left: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.small-btn {
    padding: 4px 10px;
    background: var(--bg-light);
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: pointer;
}

.small-btn:hover {
    background: var(--accent-red);
    color: white;
}

#cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin-bottom: 4px;
    background: var(--bg-light);
    border-radius: 6px;
}

.cart-item-emoji { font-size: 1.3rem; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 500; font-size: 0.8rem; }
.cart-item-price { font-size: 0.75rem; color: var(--accent-green); }

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
}

.cart-item-remove:hover { color: var(--accent-red); }

#cart-summary {
    padding: 12px;
    border-top: 1px solid var(--card-border);
    background: var(--bg-light);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.summary-row.discounts { color: var(--accent-green); }

.summary-row.total {
    font-weight: 700;
    font-size: 1rem;
    padding-top: 8px;
    border-top: 1px solid var(--card-border);
    margin-bottom: 0;
}

#score-preview {
    padding: 10px 12px;
    background: var(--bg-warm);
    border-top: 1px solid var(--card-border);
}

.preview-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 3px 0;
    color: var(--text-secondary);
}

.preview-row.projected {
    font-weight: 700;
    font-size: 0.95rem;
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px solid var(--card-border);
    color: var(--text-primary);
}

.preview-row.projected.winning #preview-total { color: var(--accent-green); }
.preview-row.projected.losing #preview-total { color: var(--accent-red); }

.target-display { color: var(--text-muted); font-weight: 400; }

#checkout-btn { margin: 12px; }

/* ==================== EVENT TICKER ==================== */
#event-ticker {
    background: rgba(10, 10, 20, 0.8);
    border-top: 1px solid var(--card-border);
    padding: 5px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    flex-shrink: 0;
    margin-top: auto;
}

.ticker-label {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

#ticker-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.9;
    transition: opacity 0.5s ease;
}

#event-ticker.fading #ticker-text {
    opacity: 0;
}

/* ==================== MEMBERSHIP DOCK ==================== */
#membership-dock {
    background: linear-gradient(180deg, var(--bg-medium) 0%, var(--bg-dark) 100%);
    border-top: 2px solid var(--brand-yellow);
    padding: 8px 140px 8px 15px; /* Extra right padding for fixed buttons */
    flex-shrink: 0;
}

.dock-split {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.dock-perks {
    flex: 1;
    min-width: 0;
}

.dock-coupons {
    flex: 1;
    min-width: 0;
}

.dock-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.dock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dock-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--brand-yellow);
}

.dock-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

#perk-slots {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.perk-slot {
    width: 100px;
    height: 50px;
    background: var(--bg-light);
    border: 2px dashed var(--card-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.perk-slot.empty {
    opacity: 0.5;
}

.empty-text, .locked-text {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.perk-slot.locked {
    background: var(--bg-dark);
    border-style: dashed;
    border-color: var(--text-muted);
    opacity: 0.4;
}

.perk-slot.filled {
    background: var(--perk-bg);
    border: 2px solid var(--perk-border);
    cursor: pointer;
}

.perk-slot.filled:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 196, 48, 0.3);
}

.perk-content {
    text-align: center;
    color: var(--brand-blue);
}

.perk-value {
    font-size: 0.8rem;
    font-weight: 700;
}

.perk-desc {
    font-size: 0.6rem;
    opacity: 0.8;
}

/* ==================== PA ANNOUNCEMENT ==================== */
#pa-announcement {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-yellow);
    color: var(--brand-blue);
    padding: 10px 25px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

#pa-announcement.hidden { display: none; }

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ==================== BUTTONS ==================== */
.action-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.primary {
    background: linear-gradient(145deg, var(--accent-green), #4a8c4a);
    color: white;
}

.action-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(90, 156, 90, 0.4);
}

.action-btn.secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.action-btn.secondary:hover:not(:disabled) {
    background: var(--bg-warm);
}

.action-btn.big {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.checkout-btn {
    background: linear-gradient(145deg, var(--brand-yellow), var(--accent-gold));
    color: var(--brand-blue);
}

.checkout-btn:hover:not(:disabled) {
    box-shadow: 0 4px 15px rgba(244, 196, 48, 0.4);
}

/* ==================== OVERLAYS ==================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.overlay.hidden { display: none; }

.overlay-content {
    background: var(--bg-medium);
    padding: 30px 40px;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    border: 2px solid var(--card-border);
    position: relative;
}

.overlay-content h2 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: var(--brand-yellow);
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
}

.close-btn:hover { color: var(--text-primary); }

/* ==================== INTRO ==================== */
.intro-content {
    text-align: center;
    max-width: 450px;
}

.intro-logo {
    margin-bottom: 10px;
}

.intro-symbol {
    font-size: 4rem;
    color: var(--brand-yellow);
    display: block;
    line-height: 1;
}

.intro-content h1 {
    font-size: 2.5rem;
    color: var(--brand-yellow);
    letter-spacing: 4px;
    margin: 0;
}

.intro-supermarket {
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: 6px;
    margin-top: 4px;
    font-weight: 600;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 15px;
    font-style: italic;
}

.intro-banner {
    background: var(--brand-yellow);
    color: var(--brand-blue);
    padding: 8px 20px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 25px;
    display: inline-block;
}

.intro-summary {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.intro-summary p {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.8;
}

.intro-content .action-btn { margin: 5px; }

/* ==================== RECEIPT / CHECKOUT ==================== */
.checkout-content {
    max-width: 400px;
}

.receipt {
    background: var(--receipt-bg);
    color: var(--receipt-text);
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    border-radius: 4px;
    margin-bottom: 20px;
}

.receipt-header {
    text-align: center;
    margin-bottom: 10px;
}

.receipt-logo {
    font-size: 1.2rem;
    font-weight: 700;
}

.receipt-tagline {
    font-size: 0.7rem;
    opacity: 0.7;
}

.receipt-date {
    font-size: 0.75rem;
    margin-top: 5px;
}

.receipt-divider {
    text-align: center;
    color: #999;
    margin: 8px 0;
}

#checkout-receipt {
    max-height: 150px;
    overflow-y: auto;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.receipt-row.savings { color: var(--accent-green); }
.receipt-row.total { font-weight: 700; font-size: 1rem; }

.receipt-footer {
    text-align: center;
    margin-top: 10px;
}

#checkout-actions {
    display: flex;
    gap: 15px;
}

#checkout-actions .action-btn { flex: 1; }

/* ==================== SCORE ==================== */
.score-content {
    min-width: 380px;
    text-align: center;
}

#score-breakdown { text-align: left; }

.score-section {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.score-section h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

#happiness-details, #savings-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.score-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-green);
    text-align: right;
}

.score-total, .score-target {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 1.1rem;
}

.score-total {
    font-weight: 700;
    border-top: 2px solid var(--card-border);
}

.score-target { color: var(--text-secondary); }

#score-result {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

#score-result.win {
    background: rgba(90, 156, 90, 0.2);
    color: var(--accent-green);
}

#score-result.lose {
    background: rgba(196, 69, 54, 0.2);
    color: var(--accent-red);
}

.karma-earned {
    background: linear-gradient(145deg, var(--brand-yellow), var(--accent-gold));
    color: var(--brand-blue);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    margin-bottom: 15px;
}

.karma-earned.hidden { display: none; }

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

/* ==================== PERK SHOP ==================== */
.perk-shop-content {
    min-width: 600px;
    max-width: 700px;
}

.perk-shop-header {
    text-align: center;
    margin-bottom: 20px;
}

.perk-shop-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

#perk-offerings {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.perk-offering {
    background: var(--perk-bg);
    border: 2px solid var(--perk-border);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--brand-blue);
}

.perk-offering:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(244, 196, 48, 0.4);
}

.perk-offering .perk-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--brand-blue);
    margin-bottom: 5px;
}

.perk-offering .perk-desc {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: 8px;
}

.perk-offering .perk-effect {
    font-size: 0.7rem;
    background: rgba(0,0,0,0.1);
    padding: 5px 10px;
    border-radius: 4px;
}

.current-perks {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.current-perks h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-align: center;
}

#current-perk-slots {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.current-perk-slot {
    width: 120px;
    height: 55px;
    background: var(--bg-warm);
    border: 2px dashed var(--card-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.current-perk-slot.filled {
    background: var(--perk-bg);
    border: 2px solid var(--perk-border);
    color: var(--brand-blue);
    font-weight: 600;
}

.current-perk-slot.selling {
    border-color: var(--accent-red);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ==================== FLOP CARD ==================== */
.flop-content {
    max-width: 750px;
    width: 90vw;
}

.flop-card {
    background: linear-gradient(145deg, #1e3a5f, #152a45);
    border: 3px solid var(--brand-yellow);
    border-radius: 12px;
    padding: 20px;
    color: var(--text-primary);
}

.flop-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.flop-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flop-header {
    margin-bottom: 15px;
}

.flop-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.flop-symbol {
    font-size: 2.5rem;
    color: var(--brand-yellow);
}

.flop-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--brand-yellow);
    letter-spacing: 2px;
}

.flop-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.flop-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.flop-stat {
    background: rgba(0,0,0,0.2);
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
}

.flop-stat .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.flop-stat .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-yellow);
}

.flop-perks, .flop-shop {
    margin-top: 0;
}

.flop-perks h3, .flop-shop h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 5px;
}

#flop-perk-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.flop-perk-badge {
    background: var(--accent-green);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

#flop-perk-list:empty::after {
    content: "No permanent perks yet";
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

#flop-shop-items {
    display: grid;
    gap: 8px;
}

.flop-shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flop-shop-item:hover:not(.owned):not(.locked) {
    background: rgba(244, 196, 48, 0.2);
}

.flop-shop-item.owned {
    opacity: 0.5;
    cursor: default;
}

.flop-shop-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.flop-item-info { flex: 1; }
.flop-item-name { font-weight: 600; font-size: 0.9rem; }
.flop-item-desc { font-size: 0.75rem; color: var(--text-secondary); }

.flop-item-cost {
    font-weight: 700;
    color: var(--brand-yellow);
}

/* ==================== GAME OVER ==================== */
.gameover-content {
    text-align: center;
    min-width: 380px;
}

.gameover-subtitle {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 20px;
}

#gameover-stats {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: left;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--card-border);
}

.stat-row:last-child { border-bottom: none; }

.gameover-karma {
    background: linear-gradient(145deg, var(--brand-yellow), var(--accent-gold));
    color: var(--brand-blue);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ==================== HELP ==================== */
.help-content {
    max-width: 550px;
    text-align: left;
}

.help-section {
    margin-bottom: 18px;
}

.help-section h3 {
    color: var(--brand-yellow);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.help-section p {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.9rem;
}

.help-content .action-btn {
    display: block;
    margin: 20px auto 0;
}

/* ==================== ANIMATIONS ==================== */
@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.store-item { animation: popIn 0.2s ease; }
.cart-item { animation: popIn 0.15s ease; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
    #game-main { grid-template-columns: 200px 1fr 240px; }
    .perk-slot { width: 140px; }
}

@media (max-width: 900px) {
    #perk-offerings { grid-template-columns: repeat(2, 1fr); }
    .perk-shop-content { min-width: auto; }
}

@media (max-width: 768px) {
    #game-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    #list-panel, #cart-panel { max-height: 180px; }
    #perk-slots { flex-wrap: wrap; }
    .perk-slot { width: 45%; }
}

/* Settings Button */
/* Music Mute Button (to left of settings) */
.music-mute-btn {
    position: fixed;
    bottom: 20px;
    right: 78px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-medium);
    border: 2px solid var(--brand-yellow);
    color: var(--brand-yellow);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-mute-btn:hover {
    background: var(--bg-light);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.music-mute-btn.muted {
    color: var(--text-muted);
    border-color: var(--text-muted);
    opacity: 0.7;
}

.settings-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-medium);
    border: 2px solid var(--brand-yellow);
    color: var(--brand-yellow);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.settings-btn:hover {
    background: var(--bg-light);
    transform: scale(1.1) rotate(45deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Settings Overlay */
.settings-content {
    max-width: 400px;
    text-align: left;
}

.settings-content h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--brand-yellow);
}

.settings-row {
    margin-bottom: 1.5rem;
}

.settings-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.volume-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-dark);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-yellow);
    cursor: pointer;
    border: 2px solid var(--bg-dark);
    transition: transform 0.1s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-yellow);
    cursor: pointer;
    border: 2px solid var(--bg-dark);
}

.angst-slider::-webkit-slider-thumb {
    background: var(--brand-red);
}

.angst-slider::-moz-range-thumb {
    background: var(--brand-red);
}

.volume-value {
    min-width: 45px;
    text-align: right;
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
}

.mute-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 1px solid var(--bg-light);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mute-btn:hover {
    background: var(--bg-light);
    transform: scale(1.1);
}

.mute-btn.muted {
    color: var(--brand-red);
    border-color: var(--brand-red);
}

/* Newspaper Coupon Circular */
.newspaper-content {
    max-width: 700px;
    width: 95%;
}

.newspaper {
    background: #f5f0e0;
    border: 3px solid #2d1f1a;
    box-shadow: 8px 8px 0 rgba(0,0,0,0.3);
    font-family: 'Times New Roman', Georgia, serif;
}

.newspaper-header {
    background: #2d1f1a;
    color: #f5f0e0;
    padding: 15px 20px;
    text-align: center;
    border-bottom: 3px double #f5f0e0;
}

.newspaper-masthead {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 4px;
    font-family: 'Times New Roman', Georgia, serif;
}

.newspaper-date {
    font-size: 0.85rem;
    margin-top: 5px;
    font-style: italic;
}

.newspaper-tagline {
    font-size: 1.2rem;
    margin-top: 8px;
    color: var(--brand-yellow);
    font-weight: bold;
}

.newspaper-subhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #e8e0d0;
    border-bottom: 2px dashed #999;
    color: #2d1f1a;
    font-size: 1rem;
}

.clipped-count {
    font-weight: bold;
    color: var(--accent-red);
}

.newspaper-coupons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 20px;
    background: repeating-linear-gradient(
        0deg,
        #f5f0e0,
        #f5f0e0 20px,
        #ebe6d6 20px,
        #ebe6d6 21px
    );
    max-height: 400px;
    overflow-y: auto;
}

.newspaper-coupon {
    background: white;
    border: 2px dashed #666;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    color: #2d1f1a;
}

.newspaper-coupon:hover {
    transform: scale(1.05) rotate(-1deg);
    box-shadow: 3px 3px 8px rgba(0,0,0,0.2);
    border-color: var(--accent-red);
}

.newspaper-coupon.clipped {
    background: #fffacd;
    border-color: var(--accent-red);
    border-style: solid;
    transform: rotate(-2deg);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

.newspaper-coupon.clipped::after {
    content: '✂️';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1.2rem;
}

.newspaper-coupon.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.newspaper-coupon.disabled:hover {
    transform: none;
    box-shadow: none;
}

.coupon-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 5px;
}

.coupon-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-red);
    display: block;
}

.coupon-desc {
    font-size: 0.75rem;
    color: #555;
    margin-top: 4px;
    font-style: italic;
}

.coupon-expires {
    font-size: 0.65rem;
    color: #888;
    margin-top: 6px;
    border-top: 1px dotted #ccc;
    padding-top: 4px;
}

.newspaper-footer {
    padding: 15px 20px;
    background: #e8e0d0;
    border-top: 2px dashed #999;
    text-align: center;
}

/* Coupon List in Dock */
.coupon-hint {
    font-size: 0.65rem;
    font-style: italic;
    color: var(--text-muted);
}

#coupon-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 30px;
}

#coupon-list:empty::after {
    content: 'No coupons yet';
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

.held-coupon {
    background: #fffacd;
    border: 1px dashed #999;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #2d1f1a;
}

.held-coupon:hover {
    transform: scale(1.05);
    border-color: var(--accent-red);
}

.held-coupon.selected {
    background: var(--brand-yellow);
    border-color: var(--brand-orange);
    border-style: solid;
    box-shadow: 0 0 8px rgba(244, 196, 48, 0.5);
}

.held-coupon .coupon-name {
    font-weight: bold;
    color: var(--accent-red);
}

.held-coupon .coupon-desc {
    font-size: 0.65rem;
    color: #666;
}

.held-coupon.used {
    opacity: 0.4;
    text-decoration: line-through;
    cursor: default;
}

/* Cart item with coupon applied */
.cart-item.has-coupon {
    border-left: 3px solid var(--brand-yellow);
}

/* Cart item won in combat */
.cart-item.combat-discount {
    border-left: 3px solid var(--accent-green);
    background: rgba(90, 156, 90, 0.1);
}

.cart-item.free-item {
    border-left: 3px solid gold;
    background: rgba(255, 215, 0, 0.1);
}

.cart-item .combat-won {
    font-size: 0.7rem;
    color: var(--accent-green);
    font-weight: 600;
}

.cart-item.free-item .combat-won {
    color: gold;
}

.cart-item .free-text {
    color: gold;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.cart-item .coupon-applied {
    font-size: 0.7rem;
    color: var(--accent-red);
    font-style: italic;
}

.cart-item .original-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 5px;
}

/* Cart item when coupon is selected */
.cart-item.coupon-target {
    box-shadow: 0 0 8px rgba(244, 196, 48, 0.6);
    border: 1px solid var(--brand-yellow);
    position: relative;
}

.cart-item.coupon-target::before {
    content: '✂️ Click to apply';
    position: absolute;
    top: -8px;
    right: 10px;
    background: var(--brand-yellow);
    color: #2d1f1a;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

/* ==================== COMBAT SYSTEM ==================== */
.combat-content {
    max-width: 500px;
    width: 95%;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid var(--brand-yellow);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

/* Encounter Header */
.combat-encounter-header {
    background: linear-gradient(90deg, #2d1f1a 0%, #1a1a2e 50%, #2d1f1a 100%);
    padding: 8px 15px;
    text-align: center;
    border-bottom: 2px solid var(--brand-yellow);
}

#combat-encounter-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand-yellow);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(244, 196, 48, 0.5);
    animation: encounter-pulse 1.5s ease-in-out infinite;
}

@keyframes encounter-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Enemy Section */
.combat-enemy {
    background: linear-gradient(180deg, #2d1f1a 0%, #1a1a2e 100%);
    padding: 12px 15px;
    border-bottom: 2px solid var(--brand-yellow);
}

.enemy-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.enemy-emoji {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
    animation: enemy-float 2s ease-in-out infinite;
}

@keyframes enemy-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.enemy-info {
    flex: 1;
}

/* Enemy Coins */
.enemy-coins {
    display: flex;
    gap: 6px;
    align-items: center;
}

.enemy-coin {
    width: 28px;
    height: 28px;
    position: relative;
    perspective: 500px;
}

.enemy-coin .coin-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s;
}

.enemy-coin .coin-inner.flipping {
    animation: enemy-coin-flip 0.6s ease-out forwards;
}

@keyframes enemy-coin-flip {
    0% { transform: rotateX(0deg) translateY(0); }
    25% { transform: rotateX(720deg) translateY(-30px); }
    50% { transform: rotateX(1440deg) translateY(-40px); }
    75% { transform: rotateX(2160deg) translateY(-20px); }
    100% { transform: rotateX(var(--final-rotation)) translateY(0); }
}

.enemy-coin .coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.5rem;
    backface-visibility: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.3);
}

.enemy-coin .coin-heads {
    background: linear-gradient(145deg, #cd7f32 0%, #8b4513 50%, #cd7f32 100%);
    color: #3d2314;
    border: 2px solid #8b4513;
}

.enemy-coin .coin-tails {
    background: linear-gradient(145deg, #a0522d 0%, #654321 50%, #a0522d 100%);
    color: #222;
    border: 2px solid #543210;
    transform: rotateX(180deg);
}

/* Enemy coin result states */
.enemy-coin.heads .coin-inner {
    --final-rotation: 2880deg;
}

.enemy-coin.tails .coin-inner {
    --final-rotation: 3060deg;
}

.enemy-coin.heads .coin-face.coin-heads {
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.8), 0 2px 4px rgba(0,0,0,0.4);
}

.enemy-coin.tails {
    opacity: 0.5;
}

.enemy-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.enemy-brand {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* HP Bars */
.hp-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hp-bar {
    height: 22px;
    background: #1a1a1a;
    border-radius: 11px;
    position: relative;
    overflow: hidden;
    border: 2px solid #333;
}

.hp-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease-out;
    position: relative;
}

.enemy-hp-bar .hp-fill {
    background: linear-gradient(90deg, #c44536 0%, #ff6b6b 100%);
    width: 100%;
}

.player-hp-bar {
    overflow: visible;  /* Allow damage display to show */
    display: flex;
}

.player-hp-bar .hp-fill {
    background: linear-gradient(90deg, #5a9c5a 0%, #7dde7d 100%);
    width: 100%;
}

/* Cart-occupied portion of budget bar (grayed out, locked) */
.player-hp-bar .hp-cart-fill {
    background: linear-gradient(90deg, #666 0%, #888 100%);
    border-radius: 12px 0 0 12px;
    opacity: 0.7;
}

.player-hp-bar .hp-fill:not(.hp-cart-fill) {
    border-radius: 0 12px 12px 0;
}

/* When there's no cart, restore full rounding */
.player-hp-bar .hp-fill:only-of-type {
    border-radius: 12px;
}

#budget-breakdown {
    font-size: 0.7em;
    color: var(--text-muted);
    font-weight: normal;
}

.hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Combat Arena */
.combat-arena {
    padding: 15px 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #2a2a4a 0%, #1a1a2e 100%);
}

.coin-result {
    font-size: 1rem;
    color: var(--brand-yellow);
    margin-bottom: 6px;
    min-height: 24px;
}

.coin-pouch {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    min-height: 50px;
}

/* Individual Coin */
.combat-coin {
    width: 84px;
    height: 84px;
    position: relative;
    perspective: 1000px;
}

.coin-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s;
}

.coin-inner.flipping {
    animation: coin-flip 0.8s ease-out forwards;
}

@keyframes coin-flip {
    0% { transform: rotateX(0deg) translateY(0); }
    25% { transform: rotateX(900deg) translateY(-50px); }
    50% { transform: rotateX(1800deg) translateY(-65px); }
    75% { transform: rotateX(2700deg) translateY(-30px); }
    100% { transform: rotateX(var(--final-rotation)) translateY(0); }
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    backface-visibility: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.3);
}

.coin-heads {
    background: linear-gradient(145deg, #ffd700 0%, #b8860b 50%, #ffd700 100%);
    color: #5c4333;
    border: 2px solid #b8860b;
}

.coin-tails {
    background: linear-gradient(145deg, #c0c0c0 0%, #808080 50%, #c0c0c0 100%);
    color: #333;
    border: 2px solid #666;
    transform: rotateX(180deg);
}

.coin-value {
    text-shadow: 1px 1px 1px rgba(255,255,255,0.5);
}

/* Coin result states */
.combat-coin.heads .coin-inner {
    --final-rotation: 3600deg;
}

.combat-coin.tails .coin-inner {
    --final-rotation: 3780deg;
}

.combat-coin.heads .coin-face.coin-heads {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 4px 8px rgba(0,0,0,0.4);
}

.combat-coin.tails {
    opacity: 0.5;
}

/* Damage Display - Player savings (green) */
.damage-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 800;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    animation: damage-pop 0.5s ease-out;
    pointer-events: none;
    z-index: 10;
}

.damage-display.savings {
    color: #4ade80;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 10px rgba(74, 222, 128, 0.5);
}

.damage-display.hidden {
    display: none;
}

/* Player damage display (red, over budget bar) */
.player-damage-display {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 800;
    color: #ff4444;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8), 0 0 10px rgba(255, 68, 68, 0.5);
    animation: player-damage-pop 0.6s ease-out;
    pointer-events: none;
    z-index: 10;
}

.player-damage-display.hidden {
    display: none;
}

@keyframes damage-pop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.3); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes player-damage-pop {
    0% { transform: translateY(-50%) scale(0.5); opacity: 0; }
    30% { transform: translateY(-50%) scale(1.4); opacity: 1; }
    100% { transform: translateY(-80%) scale(1); opacity: 0; }
}

/* Make arena relative for absolute positioning */
.combat-arena {
    position: relative;
}

/* Player Section */
.combat-player {
    background: linear-gradient(180deg, #1a1a2e 0%, #2d1f1a 100%);
    padding: 12px 15px;
    border-top: 2px solid var(--brand-yellow);
}

.player-hp-section {
    margin-bottom: 10px;
}

.flip-btn {
    width: 100%;
    padding: 10px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(180deg, var(--brand-yellow) 0%, var(--brand-orange) 100%);
    border: 2px solid var(--brand-orange);
    border-radius: 6px;
    color: #2d1f1a;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.flip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 196, 48, 0.4);
}

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

.flip-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Combat Actions */
.combat-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.combat-alt-actions {
    display: flex;
    gap: 8px;
}

.combat-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid;
}

.retreat-btn {
    background: linear-gradient(180deg, #4a4a4a 0%, #333 100%);
    border-color: #666;
    color: #fff;
}

.retreat-btn:hover {
    background: linear-gradient(180deg, #5a5a5a 0%, #444 100%);
    transform: translateY(-1px);
}

.buy-btn {
    background: linear-gradient(180deg, #5a9c5a 0%, #3d7a3d 100%);
    border-color: #4a8a4a;
    color: #fff;
}

.buy-btn:hover {
    background: linear-gradient(180deg, #6aac6a 0%, #4d8a4d 100%);
    transform: translateY(-1px);
}

.combat-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Current price display in retreat button */
.retreat-btn .current-price {
    font-weight: 700;
    color: var(--brand-yellow);
}

/* Victory/Defeat states */
.combat-victory .combat-arena {
    background: radial-gradient(circle at center, #2a4a2a 0%, #1a2e1a 100%);
}

.combat-defeat .combat-arena {
    background: radial-gradient(circle at center, #4a2a2a 0%, #2e1a1a 100%);
}

/* Broke state */
.combat-broke .combat-arena {
    background: radial-gradient(circle at center, #4a2a2a 0%, #2e1a1a 100%);
    animation: broke-flash 0.5s ease-out;
}

@keyframes broke-flash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5) saturate(1.5); }
}

/* ==================== WEATHER SYSTEM ==================== */
/* Weather gradients affect the game header and overall ambiance */

/* Sunny Day - Blue azure sky feeling */
body.weather-sunny-day #game-header {
    background: linear-gradient(180deg, #4a90c2 0%, #2d6a9f 50%, #1e5080 100%);
    transition: background 3s ease;
}

body.weather-sunny-day #list-panel,
body.weather-sunny-day #cart-panel {
    background: linear-gradient(180deg, #3d4a5f 0%, #2d3a4f 100%);
    transition: background 3s ease;
}

body.weather-sunny-day #store-area {
    background: linear-gradient(180deg, #2a3545 0%, #1a2535 100%);
    transition: background 3s ease;
}

/* Sunny Night - Dark starry feeling */
body.weather-sunny-night #game-header {
    background: linear-gradient(180deg, #1a1a3a 0%, #0f0f2a 50%, #0a0a1a 100%);
    transition: background 3s ease;
}

body.weather-sunny-night #list-panel,
body.weather-sunny-night #cart-panel {
    background: linear-gradient(180deg, #1a1a2a 0%, #0f0f1a 100%);
    transition: background 3s ease;
}

body.weather-sunny-night #store-area {
    background: linear-gradient(180deg, #151525 0%, #0a0a15 100%);
    transition: background 3s ease;
}

/* Rainy Day - Grey overcast feeling (current default) */
body.weather-rainy-day #game-header {
    background: linear-gradient(180deg, #3d4a55 0%, #2d3a45 50%, #1e2a35 100%);
    transition: background 3s ease;
}

body.weather-rainy-day #list-panel,
body.weather-rainy-day #cart-panel {
    background: linear-gradient(180deg, #3a4048 0%, #2a3038 100%);
    transition: background 3s ease;
}

body.weather-rainy-day #store-area {
    background: linear-gradient(180deg, #2a3035 0%, #1a2025 100%);
    transition: background 3s ease;
}

/* Rainy Night - Dark moody feeling */
body.weather-rainy-night #game-header {
    background: linear-gradient(180deg, #1a1a25 0%, #101018 50%, #0a0a10 100%);
    transition: background 3s ease;
}

body.weather-rainy-night #list-panel,
body.weather-rainy-night #cart-panel {
    background: linear-gradient(180deg, #151518 0%, #0a0a0d 100%);
    transition: background 3s ease;
}

body.weather-rainy-night #store-area {
    background: linear-gradient(180deg, #101015 0%, #050508 100%);
    transition: background 3s ease;
}

/* Rain window drops fade transition */
.rain-drops {
    transition: opacity 2s ease;
}

/* Subtle ambient glow effect on store shelves for sunny weather */
body.weather-sunny-day #store-shelves {
    box-shadow: inset 0 0 60px rgba(135, 206, 250, 0.05);
}

body.weather-sunny-night #store-shelves {
    box-shadow: inset 0 0 60px rgba(100, 100, 180, 0.03);
}

/* ==================== COIN SELECTOR ==================== */
.coin-selector-area {
    margin-top: 10px;
    text-align: center;
}

.coin-selector {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.coin-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 24px;
    background: linear-gradient(145deg, #4a3728 0%, #3d2a1f 100%);
    border: 2px solid var(--brand-yellow);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 100px;
}

.coin-select-btn:hover {
    background: linear-gradient(145deg, #5c4333 0%, #4a3728 100%);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(244, 196, 48, 0.4);
}

.coin-select-btn:active {
    transform: scale(0.98);
}

.coin-select-btn.cant-afford {
    opacity: 0.4;
    border-color: var(--accent-red);
}

.coin-select-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.coin-select-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--brand-yellow);
    text-shadow: 0 0 10px rgba(244, 196, 48, 0.5);
}

.coin-select-hint {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-style: italic;
}

.coin-risk-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Coin type color variations */
.combat-coin.penny .coin-heads,
.enemy-coin.penny .coin-heads {
    background: linear-gradient(145deg, #cd7f32 0%, #8b4513 50%, #cd7f32 100%);
    border-color: #8b4513;
}

.combat-coin.penny .coin-tails,
.enemy-coin.penny .coin-tails {
    background: linear-gradient(145deg, #a0522d 0%, #654321 50%, #a0522d 100%);
    border-color: #543210;
}

.combat-coin.nickel .coin-heads,
.enemy-coin.nickel .coin-heads {
    background: linear-gradient(145deg, #a0a0a0 0%, #707070 50%, #a0a0a0 100%);
    border-color: #707070;
}

.combat-coin.nickel .coin-tails,
.enemy-coin.nickel .coin-tails {
    background: linear-gradient(145deg, #808080 0%, #505050 50%, #808080 100%);
    border-color: #505050;
}

.combat-coin.dime .coin-heads,
.enemy-coin.dime .coin-heads {
    background: linear-gradient(145deg, #c0c0c0 0%, #909090 50%, #c0c0c0 100%);
    border-color: #909090;
}

.combat-coin.dime .coin-tails,
.enemy-coin.dime .coin-tails {
    background: linear-gradient(145deg, #a0a0a0 0%, #707070 50%, #a0a0a0 100%);
    border-color: #707070;
}

.combat-coin.quarter .coin-heads,
.enemy-coin.quarter .coin-heads {
    background: linear-gradient(145deg, #ffd700 0%, #b8860b 50%, #ffd700 100%);
    border-color: #b8860b;
}

.combat-coin.quarter .coin-tails,
.enemy-coin.quarter .coin-tails {
    background: linear-gradient(145deg, #daa520 0%, #8b6914 50%, #daa520 100%);
    border-color: #8b6914;
}

/* Enemy coins section styling */
.enemy-coins-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

#enemy-coins {
    min-height: 28px;
    padding: 4px;
    border-radius: 6px;
    background: rgba(80, 80, 80, 0.3);
    border: 1px solid rgba(120, 120, 120, 0.5);
    transition: all 0.3s ease;
}

/* Turn red when dealing damage */
.enemy-coins-wrapper.dealing-damage #enemy-coins {
    background: rgba(196, 69, 54, 0.3);
    border: 1px solid var(--accent-red);
    box-shadow: 0 0 10px rgba(196, 69, 54, 0.4);
}

.enemy-coins-label {
    font-size: 0.55rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 3px;
    opacity: 0.8;
    transition: color 0.3s ease;
}

/* Turn label red when dealing damage */
.enemy-coins-wrapper.dealing-damage .enemy-coins-label {
    color: var(--accent-red);
}

/* Turn green when enemy flip fails completely */
.enemy-coins-wrapper.flip-failed #enemy-coins {
    background: rgba(74, 222, 128, 0.3);
    border: 1px solid #4ade80;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
}

.enemy-coins-wrapper.flip-failed .enemy-coins-label {
    color: #4ade80;
}

/* Empty coin slot */
.enemy-coin.empty-slot {
    opacity: 0.25;
}

.enemy-coin.empty-slot .coin-empty {
    background: linear-gradient(145deg, #444 0%, #333 50%, #444 100%);
    border: 2px solid #555;
    color: #666;
}

/* ==================== MATCH MODE ==================== */
/* Match button - circular, near settings */
.match-mode-btn {
    position: fixed;
    bottom: 20px;
    right: 140px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #2d6a4f, #1b4332);
    color: #fff;
    border: 2px solid #40916c;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-mode-btn:hover {
    background: linear-gradient(145deg, #40916c, #2d6a4f);
    transform: scale(1.1);
}

.match-mode-btn.active {
    background: linear-gradient(145deg, #c44536, #9d3426);
    border-color: #e55b4a;
}

/* Match Table (green felt) */
#store-shelves.match-table {
    background: linear-gradient(180deg, #1a4d2e 0%, #0d3320 50%, #0a2818 100%) !important;
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    padding: 15px 20px 50px 20px;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    grid-template-columns: none !important;
    align-content: flex-start !important;
    overflow: visible;
}

/* Keep event ticker visible in match mode */
#store-shelves.match-table ~ #event-ticker {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    display: flex !important;
    background: rgba(10, 10, 20, 0.95);
}

.match-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 5px;
    margin-bottom: 50px;
}

.deck-stack {
    width: 50px;
    height: 70px;
    background: linear-gradient(145deg, #1e3a5f, #152a45);
    border: 2px solid #2a4a6f;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        2px 2px 0 #0d1d30,
        4px 4px 0 #0a1525,
        inset 0 0 15px rgba(0,0,0,0.3);
    position: relative;
}

.deck-count {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--brand-yellow);
}

.exit-match-btn {
    background: linear-gradient(145deg, #c44536, #9d3426);
    color: #fff;
    border: 2px solid #e55b4a;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.exit-match-btn:hover {
    background: linear-gradient(145deg, #e55b4a, #c44536);
}

.reshuffle-btn {
    background: linear-gradient(145deg, #5a4a3a, #3a2a1a);
    color: var(--text-primary);
    border: 2px solid #7a6a5a;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.reshuffle-btn:hover {
    background: linear-gradient(145deg, #7a6a5a, #5a4a3a);
}

/* Card Hand */
.match-hand {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0;
}

.match-card {
    width: 140px;
    height: 196px;
    background: linear-gradient(145deg, #f5f0e6 0%, #e8e0d0 100%);
    border: 3px solid #ccc;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.match-card:hover:not(.empty):not(.selected):not(.held) {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.match-card.empty {
    background: rgba(0,0,0,0.2);
    border: 3px dashed rgba(255,255,255,0.2);
    cursor: default;
    box-shadow: none;
}

.match-card.selected {
    transform: translateY(-25px);
    border-color: var(--brand-yellow);
    box-shadow:
        0 0 30px rgba(244, 196, 48, 0.8),
        0 0 60px rgba(244, 196, 48, 0.4),
        0 15px 30px rgba(0,0,0,0.5);
    z-index: 10;
}

.match-card.matched {
    animation: matchPulse 0.5s ease;
    opacity: 0;
    transform: scale(1.1);
}

.match-card.no-match {
    animation: cardShake 0.3s ease;
}

.match-card.dealing {
    animation: cardDeal 0.3s ease;
}

@keyframes matchPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 30px rgba(74, 222, 128, 0.8); }
    100% { transform: scale(0.8); opacity: 0; }
}

@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

@keyframes cardDeal {
    0% { transform: translateX(-100px) rotate(-10deg); opacity: 0; }
    100% { transform: translateX(0) rotate(0); opacity: 1; }
}

/* Card Inner Content */
.card-inner {
    padding: 6px;
    text-align: center;
    color: #2d1f1a;
    height: calc(100% - 28px);
    display: flex;
    flex-direction: column;
}

.card-emoji {
    font-size: 1.8rem;
    margin-bottom: 2px;
}

.card-name {
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 1px;
    line-height: 1.1;
}

.card-brand {
    font-size: 0.55rem;
    color: #666;
    margin-bottom: 2px;
    line-height: 1.1;
}

.card-price {
    font-size: 0.9rem;
    font-weight: 800;
    color: #c44536;
    margin-top: auto;
}

.card-category {
    font-size: 0.5rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* FLOP Button on Card */
.card-flop-btn {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #1e3a5f, #152a45);
    color: var(--brand-yellow);
    border: 1px solid var(--brand-yellow);
    padding: 2px 8px;
    font-size: 0.6rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.card-flop-btn:hover {
    background: var(--brand-yellow);
    color: #1e3a5f;
}

/* Card Suit (upper left) */
.card-suit {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    opacity: 0.9;
}

/* Card Number (upper right) */
.card-number {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 1.6rem;
    font-weight: 900;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Card Emoji (large, centered, desaturated) */
.card-emoji-large {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4.5rem;
    filter: saturate(0.4) brightness(1.1);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Card Price (lower right) */
.card-price {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Card Quality (lower left) */
.card-quality {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Suit-specific card styles */
.match-card.suit-meat {
    border-color: #c44536;
}

.match-card.suit-dairy {
    border-color: #999999;
}

.match-card.suit-produce {
    border-color: #2d8a2d;
}

.match-card.suit-grains {
    border-color: #c4a436;
}

/* Match Stats Bar */
.match-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 0;
    margin-bottom: 8px;
    padding-top: 0;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.3);
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.stat-label {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--brand-yellow);
    font-family: 'Courier New', monospace;
}

/* Order Display */
.order-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.order-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.match-order {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.order-slot {
    width: 70px;
    height: 70px;
    border: 3px solid;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.order-slot.filled {
    opacity: 0.5;
    transform: scale(0.95);
}

.order-slot .order-icon {
    font-size: 1.8rem;
}

.order-slot .order-suit {
    font-size: 0.5rem;
    margin-top: 2px;
    color: #333;
    text-shadow: 0 0 2px rgba(255,255,255,0.5);
}

/* Hold Badge */
.hold-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: var(--brand-yellow);
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 2px;
    border: 2px solid var(--brand-yellow);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    z-index: 10;
}

.match-exit-hint {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
}

.match-card.held {
    transform: translateY(-15px);
    box-shadow: 0 12px 24px rgba(244, 196, 48, 0.4), 0 0 20px rgba(244, 196, 48, 0.3);
}

/* Match Help Text */
.match-help {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    margin-top: 15px;
}

/* Match Message Box */
.match-message {
    position: absolute;
    bottom: 15px;
    left: 20px;
    background: rgba(10, 10, 20, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: 8px 16px;
    text-align: left;
    font-size: 0.9rem;
    color: #ccc;
    min-height: 20px;
    max-width: 400px;
    box-sizing: border-box;
    z-index: 10;
}

.match-message .ticker-label {
    color: var(--brand-yellow);
    font-weight: bold;
    margin-right: 8px;
}

/* Shuffle Button */
.shuffle-btn {
    background: linear-gradient(145deg, #5a4a3a, #3a2a1a);
    color: var(--brand-cream);
    border: 2px solid #8a7a6a;
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.shuffle-btn:hover {
    background: linear-gradient(145deg, #7a6a5a, #5a4a3a);
    transform: scale(1.05);
}

/* Checkout Button */
.checkout-btn {
    background: linear-gradient(145deg, #e6c84a, #c4a830);
    color: #333;
    border: 2px solid #d4b82e;
    padding: 10px 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checkout-btn:hover {
    background: linear-gradient(145deg, #f0d55a, #d4b840);
    transform: scale(1.05);
}
