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

/* Hide scrollbar but keep functionality */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    min-height: 100vh;
    padding-bottom: 200px;
    touch-action: manipulation;
    overflow-y: scroll;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Token Bar (fixed to bottom) */
#token-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 15px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
    z-index: 100;
    border-top: 2px solid rgba(255, 215, 0, 0.3);
}

/* Center container for tokens */
.token-stats-center {
    display: flex;
    gap: 25px;
    align-items: center;
}

/* Hamburger Menu Button */
.hamburger-button {
    position: absolute;
    right: 15px;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background: linear-gradient(145deg, #4ecdc4, #3ab8ad);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.hamburger-button:hover {
    background: linear-gradient(145deg, #3ab8ad, #2a9f95);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Hamburger Menu Dropdown */
.hamburger-menu {
    position: fixed;
    bottom: 80px;
    right: 15px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(78, 205, 196, 0.5);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 101;
    min-width: 200px;
    overflow: hidden;
}

.hamburger-menu .menu-item {
    width: 100%;
    background: transparent;
    color: #fff;
    border: none;
    padding: 14px 18px;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
}

.hamburger-menu .menu-item:last-child {
    border-bottom: none;
}

.hamburger-menu .menu-item:hover {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
}

.token-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
}

.token-stat.clickable {
    cursor: pointer;
}

.token-stat.clickable:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.token-stat.junk-active {
    border: 2px solid #4ecdc4;
    animation: junkGlow 2s ease-in-out infinite;
}

@keyframes junkGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(78, 205, 196, 0.5);
        border-color: #4ecdc4;
    }
    50% {
        box-shadow: 0 0 15px rgba(78, 205, 196, 0.8);
        border-color: #5ef7e7;
    }
}

/* Junk zone active glow */
#junk-zone.junk-active {
    border-color: #4ecdc4;
    animation: junkGlow 2s ease-in-out infinite;
}

.token-icon {
    font-size: 24px;
    line-height: 1;
}

.life-icon {
    color: #ff4444;
}

.token-count {
    font-size: 20px;
    font-weight: bold;
    color: #ffd700;
    min-width: 25px;
    text-align: center;
}


@keyframes cardFlyToPlay {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(-80px);
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100px);
        opacity: 0;
    }
}

@keyframes cardFlyToJunk {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(80px);
        opacity: 0.7;
    }
    100% {
        transform: translateY(150px);
        opacity: 0;
    }
}

@keyframes cardFlyToHand {
    0% {
        transform: translateY(-50px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(-20px) scale(0.95);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes cardDestroy {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(80px);
        opacity: 0.7;
    }
    100% {
        transform: translateY(150px);
        opacity: 0;
    }
}

/* Compact layout: cards slide right when leaving */
.compact-layout .card.destroying {
    animation: cardSlideOutRight 0.3s ease-out forwards;
}

@keyframes cardSlideOutRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100vw);
        opacity: 0;
    }
}

.card.animating-play {
    animation: cardFlyToPlay 0.5s ease-out;
    transition: none !important;
}

.card.animating-junk {
    animation: cardFlyToJunk 0.6s ease-in forwards;
    transition: none !important;
}

.card.animating-hand {
    animation: cardFlyToHand 0.5s ease-out;
    transition: none !important;
}

.card.animating-destroy {
    animation: cardDestroy 0.6s ease-in forwards;
    transition: none !important;
}

#game-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}

/* Deck Info */
#deck-info {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 10px;
}

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

.info-label {
    font-weight: bold;
    color: #ffd700;
}

/* Card Zones */
.card-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 100px;
    padding: 10px;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow-x: auto;
}

#in-play-area {
    background: rgba(50, 30, 20, 0.4);
    padding: 12px;
    border-radius: 10px;
}

#hand-area {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 10px;
}

.zone-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
    font-weight: normal;
    margin-left: 4px;
}

@media (max-width: 768px) {
    .compact-layout #in-play-area,
    .compact-layout #hand-area {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        padding-left: 0;
        padding-right: 0;
        border-radius: 0;
    }

    .compact-layout #in-play-area .zone-label,
    .compact-layout #hand-area .zone-label {
        padding-left: 8px;
        padding-right: 8px;
    }

    .compact-layout #in-play-area .card-zone,
    .compact-layout #hand-area .card-zone {
        padding: 0 4px;
    }
}

/* Cards */
.card {
    width: 160px;
    min-height: 210px;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border: 3px solid #444;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    flex-shrink: 0;
}

.card:hover, .card:active {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.card.energy {
    border: 3px solid #4ecdc4;
    background: linear-gradient(145deg, #1a3a3a, #0a2a2a);
}

.card.energy:hover, .card.energy:active {
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.6), 0 0 30px rgba(78, 205, 196, 0.3);
    border-color: #5ef7e7;
}

.card.action {
    border: 3px solid #ff6b6b;
    background: linear-gradient(145deg, #3a1a1a, #2a0a0a);
}

.card.action:hover, .card.action:active {
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.6), 0 0 30px rgba(255, 107, 107, 0.3);
    border-color: #ff8888;
}

.card.artifact {
    border: 3px solid #888;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
}

.card.artifact:hover, .card.artifact:active {
    box-shadow: 0 8px 20px rgba(170, 170, 170, 0.6), 0 0 30px rgba(170, 170, 170, 0.3);
    border-color: #aaa;
}

.card-header {
    margin-bottom: 8px;
}

.card-name {
    font-weight: bold;
    font-size: 13px;
    line-height: 1.2;
    padding-top: 35px;
}

.card-cost {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.85);
    padding: 5px 10px;
    border-radius: 6px;
    border: 2px solid #ffd700;
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
    color: #ffd700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 215, 0, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.cost-heart {
    color: #ff4444;
}

.cost-reduced {
    text-decoration: line-through;
    opacity: 0.4;
    color: #888;
}

.cost-increased {
    color: #ff6b6b;
    font-weight: bold;
}

.card-type {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 20px;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
}

.card-power {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #ffd700;
    padding: 8px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 4px;
    width: fit-content;
    align-self: center;
}

/* Discard button in normal mode */
.discard-button {
    position: relative;
    width: 100%;
    padding: 10px 8px;
    margin-top: 8px;
    margin-bottom: auto;
    font-size: 11px;
    white-space: normal;
    text-align: left;
    line-height: 1.2;
    cursor: pointer;
    background: linear-gradient(145deg, #4ecdc4, #3ab8ad);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: all 0.2s ease;
    align-self: center;
}

.discard-button:hover {
    background: linear-gradient(145deg, #3ab8ad, #2a9f95);
    transform: scale(1.02);
}

.card-ability {
    font-size: 11px;
    line-height: 1.4;
    flex: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 4px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
}

.ability-chip {
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1.3;
}

/* Ability type colors */
.ability-chip[data-ability-type="onplay"] {
    background: transparent;
    border: 1px solid transparent;
}

.ability-chip[data-ability-type="activated"] {
    background: linear-gradient(145deg, rgba(255, 107, 107, 0.4), rgba(255, 107, 107, 0.3));
    border: 2px solid rgba(255, 107, 107, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ability-chip[data-ability-type="activated"]:hover {
    background: linear-gradient(145deg, rgba(255, 107, 107, 0.5), rgba(255, 107, 107, 0.4));
    border-color: rgba(255, 107, 107, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}


.ability-chip[data-ability-type="discard"] {
    background: rgba(196, 119, 255, 0.15);
    border: 1px solid rgba(196, 119, 255, 0.3);
}


.ability-chip[data-ability-type="passive"] {
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.ability-chip[data-ability-type="ondiscard"] {
    background: rgba(255, 165, 0, 0.15);
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.junk-ability-chip {
    background: linear-gradient(145deg, #4ecdc4, #3ab8ad);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    cursor: pointer;
}


.junk-ability-chip:hover {
    background: linear-gradient(145deg, #3ab8ad, #2a9f95);
    transform: scale(1.02);
}

.junk-abilities {
    margin-top: 8px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
}

.compact-layout .junk-abilities,
.compact-modal-layout .junk-abilities {
    width: 100%;
    order: 5;
    padding: 4px;
    margin-top: 0;
    background: rgba(78, 205, 196, 0.1);
}

.ability-cost {
    font-weight: bold;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.discard-trigger {
    display: block;
    font-style: italic;
    font-size: 10px;
    color: #aaa;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-triggered {
    font-size: 10px;
    line-height: 1.4;
    font-style: normal;
    color: #ddd;
    background: rgba(78, 205, 196, 0.1);
    padding: 6px;
    border-radius: 4px;
    margin-top: 4px;
    border-left: 2px solid rgba(78, 205, 196, 0.3);
}

.card-draw-effect {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: #ff4444;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

/* Hide card-draw-effect and discard abilities in play area */
#in-play-cards .card-draw-effect,
#in-play-area .card-draw-effect,
#in-play-cards .ability-chip[data-ability-type="discard"],
#in-play-area .ability-chip[data-ability-type="discard"],
#in-play-cards .discard-button,
#in-play-area .discard-button {
    display: none;
}

/* Compact Mobile Layout */
.compact-layout .card-zone {
    flex-direction: column;
    align-items: stretch;
}

.compact-layout .card {
    position: relative;
    width: 100%;
    min-width: fit-content;
    min-height: 40px;
    height: auto;
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    gap: 0;
    flex-wrap: wrap;
}

/* Hide compact card name by default (only show in compact layout) */
.compact-card-name {
    display: none;
}

/* Compact card name line at top */
.compact-layout .compact-card-name {
    display: block;
    width: 100%;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    order: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide compact name when names are hidden */
.compact-layout.hide-card-names .compact-card-name {
    display: none;
}

/* Keep header visible but hide just the card name */
.compact-layout .card-header {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    order: 2;
}

.compact-layout .card-name {
    display: none;
}

/* Left section: Type (far left) */
.compact-layout .card-type {
    position: relative;
    top: auto;
    right: auto;
    font-size: 24px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: stretch;
    background: rgba(0, 0, 0, 0.3);
    border-right: 2px solid rgba(255, 255, 255, 0.1);
    order: 1;
}

/* Left section: Cost (after type) - now visible from header */
.compact-layout .card-cost {
    position: relative;
    top: auto;
    left: auto;
    padding: 8px 12px;
    font-size: 14px;
    flex-shrink: 0;
    display: flex !important;
    align-items: center;
    align-self: stretch;
    border-right: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: none;
    border-top: none;
    border-bottom: none;
    border-left: none;
}

/* Center section: Abilities (spanning center) */
.compact-layout .card-ability,
.compact-layout .card-triggered {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    line-height: 1.3;
    margin-top: 0;
    padding: 4px 8px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    border: none;
    background: transparent;
    order: 3;
}

.compact-layout .ability-chip,
.compact-modal-layout .ability-chip {
    flex-shrink: 1;
    white-space: normal;
    font-size: 12px;
    line-height: 1.3;
    max-width: 100%;
}

/* Right section: Discard buttons (centered in parent) */
.compact-layout .discard-button {
    position: relative;
    width: auto;
    border-radius: 0;
    padding: 10px 12px;
    font-size: 11px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    order: 3;
    flex: 0 0 auto;
    min-width: 0;
}

/* Activation buttons in play area (right-anchored) */
.compact-layout #in-play-area .card button {
    position: absolute !important;
    top: 50% !important;
    right: 8px !important;
    left: auto !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    border-radius: 0;
    margin: 0;
    padding: 10px 12px;
    font-size: 11px;
    width: auto;
    max-width: 40%;
    min-width: fit-content;
    height: 80%;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Right section: Power (anchored to right edge) */
.compact-layout .card-power {
    position: relative;
    font-size: 16px;
    padding: 8px 12px;
    width: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    align-self: stretch;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0;
    order: 4;
    margin-left: auto;
}

.compact-layout .card:hover,
.compact-layout .card:active {
    transform: translateX(5px);
}

.compact-layout .card-draw-effect {
    position: absolute !important;
    top: 3px !important;
    right: 3px !important;
    left: auto !important;
    bottom: auto !important;
    background: #ff4444;
    color: white;
    padding: 4px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 22px;
    height: 22px;
}

.junk-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(78, 205, 196, 0.9);
    color: white;
    padding: 4px 6px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.junk-badge:hover {
    background: rgba(78, 205, 196, 1);
    box-shadow: 0 0 12px rgba(78, 205, 196, 0.8), 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Junk Ability Popup */
.junk-popup {
    position: fixed;
    z-index: 2000;
    pointer-events: none;
}

.junk-popup-content {
    position: relative;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border: 3px solid #4ecdc4;
    border-radius: 10px;
    padding: 20px;
    max-width: 300px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    pointer-events: all;
    animation: popupFadeIn 0.2s ease-out;
}

.junk-popup-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 107, 107, 0.8);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.junk-popup-close:hover {
    background: rgba(255, 107, 107, 1);
    transform: scale(1.1);
}

#junk-popup-title {
    margin: 0 0 10px 0;
    color: #4ecdc4;
    font-size: 16px;
    font-weight: bold;
    padding-right: 30px;
}

#junk-popup-text {
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 5px;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Tutorial Styles */
.tutorial-modal-fullscreen {
    background-color: rgba(0, 0, 0, 0.95) !important;
    pointer-events: auto !important;
}

.tutorial-modal-fullscreen .modal-content {
    max-width: 900px;
    width: 90%;
    margin: 2% auto;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
}

.tutorial-content {
    position: relative;
    z-index: 1002;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#tutorial-step-content {
    flex: 1;
}

.tutorial-demo-zone {
    margin: 20px 0;
    padding: 20px;
    background: rgba(139, 69, 19, 0.2);
    border-radius: 10px;
    border: 2px solid rgba(139, 69, 19, 0.5);
    position: relative;
}

.tutorial-view-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    padding: 0;
    line-height: 1;
    box-shadow: none;
}

.tutorial-view-toggle:hover {
    transform: scale(1.2);
    box-shadow: none;
}

.tutorial-view-toggle:focus {
    outline: none;
    box-shadow: none;
}

.tutorial-demo-cards {
    /* Flex styles applied inline by JavaScript to wrapper */
}

.tutorial-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 107, 107, 0.8);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
    z-index: 10;
}

.tutorial-close:hover {
    background: rgba(255, 107, 107, 1);
    transform: scale(1.1);
}

#tutorial-step-content {
    padding: 20px 20px 10px 20px;
}

#tutorial-title {
    color: #4ecdc4;
    margin: 0 0 15px 0;
    font-size: 24px;
}

#tutorial-text {
    color: #fff;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    white-space: pre-line;
}

.tutorial-highlight {
    position: fixed;
    border: 3px solid #ffd700;
    border-radius: 10px;
    pointer-events: none;
    z-index: 1001;
    animation: highlightPulse 2s ease-in-out infinite;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.8),
        inset 0 0 20px rgba(255, 215, 0, 0.3);
}

/* Dark overlay that covers everything except the highlighted area */
.tutorial-highlight::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    z-index: -1;
    pointer-events: none;
}

@keyframes highlightPulse {
    0%, 100% {
        border-color: #ffd700;
        box-shadow:
            0 0 20px rgba(255, 215, 0, 0.8),
            inset 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        border-color: #ffed4e;
        box-shadow:
            0 0 30px rgba(255, 215, 0, 1),
            inset 0 0 30px rgba(255, 215, 0, 0.5);
    }
}

.tutorial-actions {
    display: flex;
    gap: 10px;
    padding: 10px 20px 20px 20px;
    justify-content: space-between;
}

.tutorial-actions button {
    flex: 1;
    max-width: 150px;
}

#tutorial-skip-btn {
    background: linear-gradient(145deg, #666, #555);
}

#tutorial-skip-btn:hover {
    background: linear-gradient(145deg, #555, #444);
}

/* End Game Modal */
.endgame-content {
    max-width: 500px;
    text-align: center;
    animation: endgameSlideIn 0.5s ease-out;
}

@keyframes endgameSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#endgame-result {
    margin-bottom: 30px;
}

#endgame-title {
    font-size: 48px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#endgame-title.victory {
    color: #95e1d3;
    text-shadow: 0 0 20px rgba(149, 225, 211, 0.8);
}

#endgame-title.defeat {
    color: #ff6b6b;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
}

#endgame-subtitle {
    font-size: 18px;
    color: #ffd700;
    margin-top: 10px;
}

#endgame-stats {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

#endgame-stats h2 {
    color: #4ecdc4;
    margin: 0 0 20px 0;
    font-size: 24px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.stat-label {
    color: #ccc;
    font-size: 16px;
}

.stat-value {
    color: #ffd700;
    font-weight: bold;
    font-size: 18px;
}

.endgame-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 20px;
    background: linear-gradient(145deg, #4ecdc4, #3ab8ad);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.endgame-btn:hover {
    background: linear-gradient(145deg, #3ab8ad, #2a9f95);
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.endgame-btn-secondary {
    background: linear-gradient(145deg, #555, #444);
}

.endgame-btn-secondary:hover {
    background: linear-gradient(145deg, #666, #555);
}

/* Buttons */
button {
    background: linear-gradient(145deg, #4ecdc4, #3ab8ad);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

button:hover, button:active {
    background: linear-gradient(145deg, #3ab8ad, #2a9f95);
    transform: scale(1.05);
}

button:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

#action-buttons {
    position: fixed;
    left: 15px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
}

#view-junk-btn {
    padding: 6px 12px;
    font-size: 14px;
}

#demolished-header {
    color: #ff6b6b;
    border-top: 2px solid rgba(255, 107, 107, 0.3);
    padding-top: 15px;
}

/* Message Area */
#message-area {
    background: rgba(0, 0, 0, 0.5);
    padding: 12px;
    border-radius: 8px;
    min-height: 50px;
    font-size: 14px;
    text-align: center;
}

.message {
    margin: 5px 0;
    padding: 8px;
    border-radius: 5px;
    animation: fadeIn 0.3s ease;
}

.message.info {
    background: rgba(78, 205, 196, 0.2);
    border-left: 3px solid #4ecdc4;
}

.message.warning {
    background: rgba(255, 107, 107, 0.2);
    border-left: 3px solid #ff6b6b;
}

.message.success {
    background: rgba(149, 225, 211, 0.2);
    border-left: 3px solid #95e1d3;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: auto;
}


.modal-content {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    margin: 5% auto;
    padding: 20px;
    border: 2px solid #888;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal.minimized .modal-content {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.modal.minimized {
    background-color: transparent;
    pointer-events: none;
}

.modal-toggle-btn {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1001;
    padding: 12px 20px;
    background: linear-gradient(145deg, #4ecdc4, #3ab8ad);
    border: 2px solid #ffd700;
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: all;
}

.modal-toggle-btn:hover {
    background: linear-gradient(145deg, #3ab8ad, #2a9f95);
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.8), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.close {
    color: #aaa;
    position: fixed;
    top: 15px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover,
.close:focus {
    color: #fff;
}

/* Investigate Modal */
#investigate-modal .modal-content {
    max-width: 900px;
}

#investigate-instructions {
    text-align: center;
    margin-bottom: 15px;
    color: #ffd700;
}

.investigate-pile {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.investigate-pile .card-zone {
    min-height: 80px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed #666;
}

.investigate-pile .card-zone.drag-over {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.investigate-pile .card-zone .card {
    height: auto;
    min-height: 210px;
}

#investigate-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 15px 80px; /* Extra horizontal padding for confirm/cancel buttons */
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 15px;
    min-height: 120px;
}

#investigate-cards .card {
    cursor: grab;
    height: auto;
    min-height: 210px;
}

#investigate-cards .card:active {
    cursor: grabbing;
}

#investigate-cards .card.dragging {
    opacity: 0.5;
}

/* Hand drag and drop */
#hand-cards .card {
    transition: transform 0.2s ease;
}

#hand-cards .card.dragging {
    opacity: 0.5;
}

.card-placeholder {
    width: 160px;
    min-height: 210px;
    background: rgba(255, 215, 0, 0.2);
    border: 3px dashed #ffd700;
    border-radius: 10px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

@media (max-width: 600px) {
    .card-placeholder {
        width: 120px;
        min-height: 170px;
    }
}

.compact-layout .card-placeholder {
    width: 100%;
    min-height: 40px;
    max-height: 60px;
    height: auto;
}


/* Selection Modal */
#selection-modal .modal-content {
    max-width: 900px;
}

#selection-title {
    text-align: center;
    margin-bottom: 10px;
}

#selection-instructions {
    text-align: center;
    margin-bottom: 15px;
    color: #ffd700;
    font-size: 14px;
}

.selection-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 15px;
    min-height: 120px;
}

#selection-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 15px;
    min-height: 120px;
}

.selection-cards .card,
#selection-cards .card {
    cursor: pointer;
    position: relative;
    height: auto;
    min-height: 210px;
}

.selection-cards .card.selected,
#selection-cards .card.selected {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    transform: translateY(-5px);
}

.selection-cards .card.selected::after,
#selection-cards .card.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ffd700;
    color: #000;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

/* Compact modal layout */
.compact-modal-layout {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    align-items: stretch !important;
}

/* Compact investigate modal layout with reversed order */
.compact-investigate-layout {
    flex-direction: column-reverse !important;
}

.compact-modal-layout .card {
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    min-height: 60px !important;
    height: auto !important;
    padding: 0 !important;
}

/* Show compact card name in modals */
.compact-modal-layout .compact-card-name {
    display: block !important;
    width: 100% !important;
    padding: 2px 4px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    order: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Hide compact name in modals when names are hidden in main game */
.hide-card-names .compact-modal-layout .compact-card-name {
    display: none !important;
}

.compact-modal-layout .card-type {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    font-size: 16px !important;
    padding: 4px 6px !important;
    display: flex !important;
    align-items: center !important;
    border-right: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    order: 1 !important;
}

.compact-modal-layout .card-header {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    margin-bottom: 0 !important;
    padding: 4px !important;
    border-right: 2px solid rgba(255, 255, 255, 0.1) !important;
    order: 2 !important;
}

.compact-modal-layout .card-name {
    display: none !important;
}

.compact-modal-layout .card-cost {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    align-self: stretch !important;
    border-right: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    box-shadow: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
}

.compact-modal-layout .card-ability,
.compact-modal-layout .card-triggered {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 4px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 3px !important;
    background: transparent !important;
    order: 3 !important;
}

.compact-modal-layout .card-power {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    padding: 4px 6px !important;
    border-left: 2px solid rgba(255, 255, 255, 0.1) !important;
    order: 4 !important;
    margin-left: auto !important;
}

.compact-modal-layout .card.selected {
    border-color: #ffd700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6) !important;
    transform: translateX(5px) !important;
}

.compact-modal-layout .card.selected::after {
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%) !important;
    z-index: 20 !important;
}

.compact-modal-layout .card-draw-effect {
    position: absolute !important;
    top: 3px !important;
    right: 3px !important;
    left: auto !important;
    bottom: auto !important;
    background: #ff4444 !important;
    color: white !important;
    padding: 4px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    z-index: 10 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    width: 22px !important;
    height: 22px !important;
}

.selection-actions {
    display: flex;
    gap: 10px;
}

.selection-actions button {
    flex: 1;
}

/* Cancel button styling - secondary/destructive actions */
#selection-cancel-btn,
#targeting-cancel-btn,
#confirm-cancel-btn,
#investigate-cancel-btn {
    background: linear-gradient(145deg, #666, #555);
}

#selection-cancel-btn:hover,
#targeting-cancel-btn:hover,
#confirm-cancel-btn:hover,
#investigate-cancel-btn:hover {
    background: linear-gradient(145deg, #555, #444);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes errorFlash {
    0%, 100% {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    50% {
        background: rgba(255, 0, 0, 0.4);
        border-color: rgba(255, 0, 0, 0.8);
    }
}

.token-stat.error {
    animation: errorShake 0.4s ease-in-out, errorFlash 0.4s ease-in-out;
}

@keyframes healthLoss {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes healthLossFlash {
    0%, 100% {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    50% {
        background: rgba(255, 0, 0, 0.5);
        border-color: rgba(255, 0, 0, 1);
    }
}

.token-stat.life-loss {
    animation: healthLoss 0.6s ease-in-out, healthLossFlash 0.6s ease-in-out;
}

@keyframes drawCard {
    0% {
        transform: translateX(0) translateY(0) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateX(-50px) translateY(-100px) scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: translateX(0) translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes libraryPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(78, 205, 196, 0);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 20px rgba(78, 205, 196, 0.6);
    }
}

.card.drawing {
    animation: drawCard 0.5s ease-out;
}

#library-stat.drawing {
    animation: libraryPulse 0.5s ease-in-out;
}

@keyframes healthGain {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes healthGainFlash {
    0%, 100% {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }
    50% {
        background: rgba(149, 225, 211, 0.6);
        border-color: rgba(149, 225, 211, 1);
    }
}

.token-stat.life-gain {
    animation: healthGain 0.6s ease-in-out, healthGainFlash 0.6s ease-in-out;
}

/* Mobile Optimization */
@media (max-width: 600px) {
    body {
        padding-bottom: 65px;
    }

    #token-bar {
        gap: 10px;
        padding: 10px 8px;
    }

    .token-stat {
        gap: 6px;
        padding: 5px 10px;
    }

    .token-icon {
        font-size: 20px;
    }

    .token-count {
        font-size: 16px;
        min-width: 20px;
    }

    .card {
        width: 120px;
        min-height: 170px;
        padding: 8px;
    }

    .card-name {
        font-size: 11px;
    }

    .card-ability {
        font-size: 10px;
    }

    button {
        padding: 10px 16px;
        font-size: 14px;
    }

    .modal-content {
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        padding: 15px;
        border-radius: 0;
        min-height: 100vh;
    }

    #tutorial-modal .modal-content {
        min-height: auto;
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 20px;
    }

    .compact-modal-layout .card-zone {
        padding: 0 !important;
    }
}

/* Landscape optimization for mobile */
@media (orientation: landscape) and (max-height: 500px) {
    #game-container {
        gap: 8px;
    }

    .card-zone {
        min-height: 60px;
    }
}

/* Help Button */
.help-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, #4ecdc4, #3ab8ad);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.help-button:hover {
    background: linear-gradient(145deg, #3ab8ad, #2a9f95);
    transform: scale(1.1);
}

/* Sort Hand Button */
.sort-hand-btn {
    background: rgba(78, 205, 196, 0.3);
    border: 1px solid rgba(78, 205, 196, 0.5);
    color: #4ecdc4;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 8px;
    margin-bottom: 5px;
    transition: all 0.2s ease;
}

.sort-hand-btn:hover {
    background: rgba(78, 205, 196, 0.5);
    transform: scale(1.05);
}

/* Undo Button (bottom left) */
.undo-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(145deg, #4ecdc4, #3ab8ad);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 0;
}

.undo-button:hover:not(:disabled) {
    background: linear-gradient(145deg, #3ab8ad, #2a9f95);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.undo-button:active:not(:disabled) {
    transform: scale(0.95);
}

.undo-button:disabled {
    background: linear-gradient(145deg, #666, #555);
    border-color: rgba(255, 255, 255, 0.1);
    color: #888;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Advanced Game Mode */
.advanced-controls {
    margin: 20px 0;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.control-row label {
    font-weight: bold;
    min-width: 150px;
}

.control-row input[type="number"] {
    width: 80px;
    padding: 8px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #666;
    border-radius: 4px;
    color: #fff;
}

.control-row select {
    padding: 8px 12px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #666;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.control-row select:hover {
    border-color: #4ecdc4;
}

.control-row select:focus {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 8px rgba(78, 205, 196, 0.3);
}

.control-row select option {
    background: #1a1a1a;
    color: #fff;
    padding: 8px;
}

.control-hint {
    color: #888;
    font-style: italic;
    font-size: 14px;
}

.control-info {
    background: rgba(78, 205, 196, 0.1);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #4ecdc4;
    margin-top: 20px;
}

.control-info strong {
    color: #4ecdc4;
    display: block;
    margin-bottom: 10px;
}

.control-info ol {
    margin: 10px 0 10px 20px;
    color: #ddd;
}

.control-info p {
    color: #aaa;
}

/* Right Side Zones (Library and Junk) */
#right-zones {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 15px;
    z-index: 50;
    transition: all 0.3s ease;
}

.side-zone {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.side-zone:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

/* Compact views (always visible) */
.library-compact,
.junk-compact,
.score-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Hide full-size views (always use compact) */
.card-back,
.junk-preview,
.score-display {
    display: none !important;
}

.compact-icon {
    font-size: 32px;
}

.compact-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: rgba(255, 215, 0, 0.95);
    color: #000;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
    border: 2px solid rgba(0, 0, 0, 0.6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive: Narrow screens */
@media (max-width: 1024px) {
    #right-zones {
        gap: 10px;
    }

    .side-zone {
        padding: 8px;
        width: 50px;
        height: 50px;
    }

    .compact-icon {
        font-size: 24px;
    }

    .compact-badge {
        font-size: 9px;
        padding: 1px 4px;
        min-width: 18px;
    }
}

/* Library Card Back */
.card-back {
    width: 160px;
    height: 90px;
    background: linear-gradient(145deg, #2a5298, #1e3c72);
    border: 2px solid #4ecdc4;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-back:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(78, 205, 196, 0.4);
}

.card-back-content {
    text-align: center;
}

.card-back-icon {
    font-size: 40px;
    margin-bottom: 6px;
}

.card-back-count {
    font-size: 14px;
    font-weight: bold;
    color: #ffd700;
}

/* Score Display */
.score-display {
    text-align: center;
    padding: 8px;
    width: 120px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.score-display:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.score-icon {
    font-size: 32px;
    margin-bottom: 4px;
}

.score-label {
    font-size: 12px;
    font-weight: bold;
    color: #4ecdc4;
    margin-bottom: 4px;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#score-zone {
    min-height: auto;
}

.score-compact {
    cursor: pointer;
}

/* Junk Preview */
.junk-preview {
    width: 180px;
}

.junk-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

.junk-icon {
    font-size: 18px;
}

.junk-label {
    color: #ddd;
    font-size: 12px;
}

.junk-preview-cards {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 50px;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 8px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.junk-preview-card {
    font-size: 10px;
    padding: 3px 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ddd;
}

.junk-expand-btn {
    width: 100%;
    padding: 8px;
    background: linear-gradient(145deg, #4ecdc4, #3ab8ad);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.junk-expand-btn:hover {
    background: linear-gradient(145deg, #3ab8ad, #2a9f95);
    transform: scale(1.02);
}

/* Glossary Modal */
#glossary-content {
    padding: 10px;
}

.glossary-section {
    margin-bottom: 25px;
}

.glossary-section h3 {
    color: #4ecdc4;
    margin-bottom: 10px;
    border-bottom: 2px solid rgba(78, 205, 196, 0.3);
    padding-bottom: 5px;
}

.glossary-item {
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    line-height: 1.6;
}

.glossary-item strong {
    color: #4ecdc4;
    display: block;
    margin-bottom: 4px;
}

/* High Scores / Leaderboard */
.high-scores-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid rgba(78, 205, 196, 0.3);
}

.high-scores-section h3 {
    color: #4ecdc4;
    margin-bottom: 15px;
    text-align: center;
    font-size: 20px;
}

.high-scores-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.score-entry {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.score-entry:hover {
    background: rgba(255, 255, 255, 0.08);
}

.score-entry-first {
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.score-rank {
    font-size: 18px;
    font-weight: bold;
    color: #4ecdc4;
    min-width: 35px;
    text-align: center;
}

.score-entry-first .score-rank {
    color: #ffd700;
}

.score-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.score-main {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.score-stat {
    font-size: 16px;
    font-weight: bold;
    color: #ddd;
    flex: 0 0 auto;
}

.score-points {
    font-size: 20px;
    font-weight: bold;
    color: #4ecdc4;
}

.score-entry-first .score-points {
    color: #ffd700;
}

.score-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* Leaderboard Info Section */
.leaderboard-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
    border-radius: 8px;
}

.leaderboard-info-title {
    font-weight: 600;
    color: #4ecdc4;
    margin-bottom: 10px;
    font-size: 14px;
}

.leaderboard-info-list {
    margin: 0 0 10px 20px;
    padding: 0;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.leaderboard-info-list li {
    margin-bottom: 4px;
}

.leaderboard-info-example {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
