.clash-run-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: #0a0a1a;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: white;
    overflow-x: hidden;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}
.clash-run-overlay.rotated {
    transform: rotate(-90deg);
    transform-origin: center center;
    width: 100vh;
    height: 100vw;
    left: calc((100vw - 100vh) / 2);
    top: calc((100vh - 100vw) / 2);
}

.cr-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    box-sizing: border-box;
    touch-action: pan-y;
}
.clash-run-overlay:not(.rotated) .cr-screen {
    min-height: 100vh;
}
.clash-run-overlay.rotated .cr-screen {
    min-height: 100vw;
}

/* === STARTER SELECT === */

.cr-title {
    font-size: 24px;
    text-align: center;
    margin: 8px 0 4px 0;
    background: linear-gradient(to bottom, #f1c40f, #e67e22);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    letter-spacing: 2px;
}

.cr-subtitle {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px 0;
    text-align: center;
}

.cr-starter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 420px;
}

.cr-starter-card {
    background: linear-gradient(135deg, #1a2a3a, #0f1a2a);
    border: 2px solid #2c3e50;
    border-radius: 10px;
    padding: 14px 10px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    text-align: center;
    min-height: 60px;
}

.cr-starter-card:hover, .cr-starter-card:active {
    transform: scale(1.04);
    border-color: #f1c40f;
}

.cr-starter-name {
    font-size: 15px;
    font-weight: bold;
    color: #f1c40f;
    margin-bottom: 4px;
}

.cr-starter-desc {
    font-size: 11px;
    color: #7f8c8d;
    margin-bottom: 6px;
}

.cr-starter-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    margin-bottom: 6px;
}

.cr-card-tag {
    background: linear-gradient(to bottom, #34495e, #2c3e50);
    border: 1px solid #4a6a8a;
    border-radius: 5px;
    padding: 4px 6px;
    font-size: 11px;
    color: #ecf0f1;
    white-space: nowrap;
}

.cr-card-tag.powerup-tag {
    border-color: #8e44ad;
    background: linear-gradient(to bottom, #2d1a4e, #1a0e2e);
}

.cr-starter-gold {
    font-size: 13px;
    color: #f1c40f;
    margin: 4px 0;
}

.cr-starter-perk {
    font-size: 11px;
    color: #2ecc71;
    font-style: italic;
}

.cr-btn {
    padding: 12px 28px;
    border: 2px solid #555;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 8px 4px;
    transition: transform 0.1s, background 0.15s;
    color: white;
    background: linear-gradient(to bottom, #444, #222);
    min-height: 44px;
    width: 100%;
    max-width: 300px;
    box-sizing: border-box;
}

.cr-btn:hover { transform: scale(1.05); }
.cr-btn:active { transform: scale(0.97); }

.cr-btn-fight {
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    border-color: #ff6b6b;
    font-size: 18px;
    padding: 14px 32px;
    animation: cr-pulse 1.5s infinite;
}

.cr-btn-shop {
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    border-color: #2ecc71;
}

.cr-btn-victory {
    background: linear-gradient(to bottom, #f1c40f, #d4ac0d);
    border-color: #f9e547;
    color: #1a1a2e;
}

.cr-btn-reroll {
    background: linear-gradient(to bottom, #2980b9, #1a5276);
    border-color: #3498db;
    font-size: 14px;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.cr-btn-back, .cr-btn-quit {
    background: linear-gradient(to bottom, #555, #333);
    font-size: 14px;
    padding: 10px 20px;
}

.cr-btn-retry {
    background: linear-gradient(to bottom, #e67e22, #d35400);
    border-color: #f39c12;
}

@keyframes cr-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(231,76,60,0.4); }
    50% { box-shadow: 0 0 25px rgba(231,76,60,0.8); }
}

/* === BATTLE MAP === */

.cr-map-screen {
    padding-top: 12px;
    padding-left: 10px;
    padding-right: 10px;
}

.cr-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 420px;
    margin-bottom: 8px;
}

.cr-map-title {
    font-size: 20px;
    margin: 0;
    color: #f1c40f;
}

.cr-map-gold {
    font-size: 16px;
    color: #f1c40f;
    font-weight: bold;
}

.cr-map-deck {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 5px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}

.cr-map-deck-label {
    font-size: 12px;
    color: #999;
    margin-right: 4px;
    grid-column: 1 / -1;
    font-weight: 600;
}

.cr-map-powerups {
    font-size: 16px;
    grid-column: 1 / -1;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cr-map-list {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.cr-map-battle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.04);
    border: 2px solid transparent;
    border-radius: 10px;
    transition: background 0.15s;
    min-height: 48px;
}

.cr-map-battle.current {
    border-color: #e74c3c;
    background: rgba(231,76,60,0.12);
    box-shadow: 0 0 12px rgba(231,76,60,0.2);
}

.cr-map-battle.done {
    border-color: #27ae60;
    background: rgba(39,174,96,0.08);
}

.cr-map-battle.locked {
    opacity: 0.35;
}

.cr-map-num {
    font-size: 24px;
    font-weight: bold;
    width: 34px;
    text-align: center;
    color: #f1c40f;
    flex-shrink: 0;
}

.cr-map-info { flex: 1; min-width: 0; }

.cr-map-stage {
    font-size: 13px;
    color: #bbb;
    font-weight: bold;
}

.cr-map-diff {
    font-size: 11px;
    color: #888;
}

.cr-map-mods {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 3px;
}

.cr-mod-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(231,76,60,0.2);
    border: 1px solid rgba(231,76,60,0.4);
    color: #e74c3c;
}

.cr-map-result {
    font-size: 16px;
    flex-shrink: 0;
}

.cr-map-crown-empty {
    opacity: 0.15;
}

.cr-map-deck-section {
    width: 100%;
    max-width: 420px;
    margin-bottom: 12px;
}

.cr-map-pu-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.cr-map-pu-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #2a1550, #1a0e30);
    border: 1px solid rgba(142,68,173,0.3);
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 10px;
    color: #bbb;
    cursor: pointer;
}
.cr-pu-tooltip {
    z-index: 50;
    background: rgba(0,0,0,0.92);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    max-width: 220px;
    color: #f1c40f;
    font-size: 11px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
    pointer-events: auto;
}

/* === POST-BATTLE RESULTS === */

.cr-results-screen {
    justify-content: center;
}

.cr-result-title {
    font-size: 24px;
    margin: 0 0 10px 0;
}

.cr-result-title.victory { color: #2ecc71; }
.cr-result-title.tie { color: #f39c12; }

.cr-crowns {
    font-size: 32px;
    margin-bottom: 16px;
}

.cr-crown-empty { opacity: 0.15; }

.cr-earnings {
    width: 100%;
    max-width: 320px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 12px;
}

.cr-earning-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.cr-earning-row.total {
    font-weight: bold;
    font-size: 16px;
    padding-top: 8px;
}

.cr-earning-divider {
    height: 1px;
    background: rgba(255,255,255,0.15);
    margin: 6px 0;
}

.positive { color: #2ecc71; }
.negative { color: #e74c3c; }

.cr-gold-display {
    font-size: 18px;
    font-weight: bold;
    color: #f1c40f;
    margin-bottom: 12px;
}

/* === SHOP === */

.cr-shop-screen {
    padding-top: 12px;
    background: radial-gradient(ellipse at 50% 20%, rgba(30,50,80,0.5) 0%, transparent 60%);
}

/* --- Header --- */
.cr-shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 420px;
    margin-bottom: 6px;
}
.cr-shop-title-row { display: flex; flex-direction: column; }
.cr-shop-title {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(to bottom, #f9e547, #d4a017);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}
.cr-shop-battle-hint {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 2px;
}
.cr-war-chest-tag {
    font-size: 10px;
    font-weight: 700;
    color: #f1c40f;
    background: rgba(241,196,15,0.12);
    border: 1px solid rgba(241,196,15,0.3);
    border-radius: 4px;
    padding: 2px 8px;
    margin-top: 3px;
    display: inline-block;
}
.cr-shop-gold {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 18px;
    font-weight: 900;
    color: #f1c40f;
    background: linear-gradient(135deg, #2a1a00, #1a1200);
    border: 1.5px solid #8b6914;
    border-radius: 8px;
    padding: 5px 12px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.cr-coin-icon {
    width: 22px;
    height: 22px;
    image-rendering: pixelated;
}
.cr-coin-sm {
    width: 14px;
    height: 14px;
    image-rendering: pixelated;
    vertical-align: -2px;
    margin-right: 1px;
}

.cr-shop-divider {
    width: 100%;
    max-width: 420px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(241,196,15,0.25), transparent);
    margin: 8px 0 12px 0;
}

/* --- Section Headers --- */
.cr-shop-section {
    width: 100%;
    max-width: 420px;
    margin-bottom: 14px;
}
.cr-section-header {
    font-size: 12px;
    color: #95a5a6;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cr-section-icon { font-size: 14px; }
.cr-pu-count {
    font-size: 10px;
    color: #666;
    margin-left: auto;
    font-weight: normal;
}
.cr-full {
    color: #e74c3c;
    font-size: 10px;
    margin-left: auto;
}

/* --- Shop Items Grid --- */
.cr-shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

/* --- Card Frames --- */
.cr-shop-card {
    position: relative;
    background: linear-gradient(160deg, #1a2a3d, #0f1925);
    border: 2px solid #2a4060;
    border-radius: 10px;
    padding: 10px 8px 10px 8px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}
.cr-shop-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.04), transparent 40%);
    pointer-events: none;
    border-radius: 8px;
}
.cr-shop-card:hover:not(.sold):not(.too-expensive) {
    transform: translateY(-3px) scale(1.03);
    border-color: #f1c40f;
    box-shadow: 0 6px 20px rgba(241,196,15,0.2), 0 0 0 1px rgba(241,196,15,0.1);
}
.cr-shop-card:active:not(.sold):not(.too-expensive) {
    transform: translateY(0) scale(0.98);
}
.cr-shop-card.sold {
    opacity: 0.25;
    pointer-events: none;
    filter: grayscale(0.6);
}
.cr-shop-card.too-expensive:not(.sold) {
    opacity: 0.45;
    border-color: #333;
}

/* --- Card Frame Sprite Background --- */
.cr-sc-frame {
    position: relative;
    width: 72px;
    height: 80px;
    margin: 0 auto 6px auto;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    image-rendering: auto;
    border-radius: 4px;
}
.cr-sc-frame.upgrade-frame {
    border: 1px solid rgba(46,204,113,0.3);
    box-shadow: 0 0 12px rgba(46,204,113,0.15);
}
.cr-sc-elixir {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d252ff, #8e44ad);
    border: 1.5px solid #fff;
    color: white;
    font-size: 11px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.cr-sc-sprite {
    position: absolute;
    inset: 8px 6px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: auto;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}

/* --- Stats Row --- */
.cr-sc-stats-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 3px 0 4px 0;
}
.cr-sc-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.cr-sc-stat-val {
    font-size: 12px;
    font-weight: 900;
    color: #5dade2;
    line-height: 1;
}
.cr-sc-stat-lbl {
    font-size: 7px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.cr-shop-card-name {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 3px;
    color: #ecf0f1;
    line-height: 1.2;
}
.cr-shop-card-price {
    font-size: 13px;
    font-weight: 900;
    color: #f1c40f;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

/* --- Leveled Shop Cards --- */
.cr-shop-card.leveled {
    border-width: 2px;
}
.cr-shop-card.lvl-1 {
    border-color: rgba(46, 204, 113, 0.5);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.15), inset 0 0 8px rgba(46, 204, 113, 0.05);
}
.cr-shop-card.lvl-2 {
    border-color: rgba(52, 152, 219, 0.5);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2), inset 0 0 8px rgba(52, 152, 219, 0.05);
}
.cr-shop-card.lvl-3 {
    border-color: rgba(155, 89, 182, 0.6);
    box-shadow: 0 0 12px rgba(155, 89, 182, 0.25), inset 0 0 8px rgba(155, 89, 182, 0.08);
}
.cr-shop-card.lvl-4 {
    border-color: rgba(241, 196, 15, 0.6);
    box-shadow: 0 0 14px rgba(241, 196, 15, 0.3), inset 0 0 10px rgba(241, 196, 15, 0.08);
}
.cr-sc-lvl-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 900;
    color: #fff;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.cr-sc-lvl-badge.lvl-1 { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.cr-sc-lvl-badge.lvl-2 { background: linear-gradient(135deg, #3498db, #2980b9); }
.cr-sc-lvl-badge.lvl-3 { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.cr-sc-lvl-badge.lvl-4 { background: linear-gradient(135deg, #f1c40f, #e67e22); }
.cr-shop-lvl-tag {
    display: inline-block;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    background: rgba(46, 204, 113, 0.7);
    vertical-align: middle;
    margin-left: 2px;
}
.cr-shop-card.lvl-2 .cr-shop-lvl-tag { background: rgba(52, 152, 219, 0.7); }
.cr-shop-card.lvl-3 .cr-shop-lvl-tag { background: rgba(155, 89, 182, 0.7); }
.cr-shop-card.lvl-4 .cr-shop-lvl-tag { background: rgba(241, 196, 15, 0.7); }
.cr-sc-stat.boosted .cr-sc-stat-val {
    color: #2ecc71;
}

/* --- Sold Stamp --- */
.cr-sold-stamp {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    color: rgba(255,255,255,0.5);
    letter-spacing: 3px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    transform: rotate(-12deg);
}

/* --- Upgrade Card Extras --- */
.cr-upgrade-desc {
    font-size: 12px;
    font-weight: 700;
    color: #2ecc71;
    margin-bottom: 2px;
}
.cr-upgrade-stats {
    font-size: 9px;
    color: #7f8c8d;
    margin-bottom: 4px;
}

/* --- Tower Upgrade Cards --- */
.cr-shop-card.tower-upgrade-card {
    border-color: #2874a6;
    background: linear-gradient(160deg, #1a3a5c, #0d1f33);
}
.cr-shop-card.tower-upgrade-card::before {
    background: linear-gradient(to bottom, rgba(52,152,219,0.08), transparent 40%);
}
.cr-shop-card.tower-upgrade-card:hover:not(.sold):not(.too-expensive):not(.maxed) {
    border-color: #3498db;
    box-shadow: 0 6px 20px rgba(52,152,219,0.25), 0 0 0 1px rgba(52,152,219,0.1);
    transform: translateY(-3px);
}
.cr-shop-card.tower-upgrade-card.maxed {
    opacity: 0.5;
    pointer-events: none;
}
.cr-tower-upgrade-icon {
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* --- Power-Up Cards --- */
.cr-shop-card.powerup {
    border-color: #4a2080;
    background: linear-gradient(160deg, #2a1550, #150a30);
}
.cr-shop-card.powerup::before {
    background: linear-gradient(to bottom, rgba(200,100,255,0.06), transparent 40%);
}
.cr-shop-card.powerup:hover:not(.sold):not(.too-expensive) {
    border-color: #d252ff;
    box-shadow: 0 6px 20px rgba(210,82,255,0.2), 0 0 0 1px rgba(210,82,255,0.1);
}
.cr-pu-frame {
    position: relative;
    width: 52px;
    height: 52px;
    margin: 0 auto 4px auto;
    background: radial-gradient(circle, rgba(142,68,173,0.25) 0%, transparent 70%);
    border-radius: 12px;
    border: 1.5px solid rgba(142,68,173,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cr-rarity-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 7px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}
.cr-pu-tier-badge { display: none; }
.cr-shop-pu-icon { font-size: 26px; }
.cr-shop-pu-desc {
    font-size: 9px;
    color: #8e8e8e;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* --- Chains With --- */
.cr-chains-with {
    font-size: 8px;
    color: #95a5a6;
    margin: 2px 0 4px;
    line-height: 1.4;
    text-align: center;
}
.cr-chain-item {
    display: inline-block;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    padding: 1px 4px;
    margin: 1px;
    white-space: nowrap;
    font-size: 8px;
}
.cr-chain-item.owned {
    background: rgba(241,196,15,0.2);
    color: #f1c40f;
    border: 1px solid rgba(241,196,15,0.4);
}

/* --- Synergy Tag on Cards --- */
.cr-synergy-tag {
    font-size: 8px;
    color: #f1c40f;
    background: rgba(241,196,15,0.15);
    border: 1px solid rgba(241,196,15,0.3);
    border-radius: 3px;
    padding: 1px 6px;
    margin: 2px auto 4px;
    display: inline-block;
}
.cr-shop-card.has-synergy {
    border-color: rgba(241,196,15,0.5);
    box-shadow: 0 0 12px rgba(241,196,15,0.15);
}
.cr-shop-card.has-synergy::before {
    background: linear-gradient(to bottom, rgba(241,196,15,0.08), transparent 50%);
}

/* --- Upgrade Card --- */
.cr-shop-card.upgrade-card {
    border-color: #1e7a45;
    background: linear-gradient(160deg, #142a1a, #0a1a0e);
}
.cr-shop-card.upgrade-card::before {
    background: linear-gradient(to bottom, rgba(46,204,113,0.06), transparent 40%);
}
.cr-shop-card.upgrade-card:hover:not(.sold):not(.too-expensive) {
    border-color: #2ecc71;
    box-shadow: 0 6px 20px rgba(46,204,113,0.2);
}

/* --- Sell Cards Grid --- */
.cr-sell-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cr-sell-card {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #2a1414, #1a0a0a);
    border: 1.5px solid #5a2020;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.12s;
    min-width: 120px;
}
.cr-sell-card:hover {
    border-color: #e74c3c;
    transform: scale(1.03);
    background: linear-gradient(135deg, #3a1a1a, #2a0e0e);
}
.cr-sell-sprite {
    width: 22px;
    height: 22px;
    image-rendering: auto;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.cr-sell-name {
    font-size: 11px;
    flex: 1;
    color: #ccc;
}
.cr-sell-price {
    font-size: 12px;
    font-weight: 700;
    color: #2ecc71;
}

/* --- Deck Mini Cards --- */
.cr-deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 6px;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
}
.cr-mini-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.1;
    background: linear-gradient(135deg, #1a2a3d, #0f1925);
    border: 1.5px solid #2a4060;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cr-mini-card img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.cr-mini-lvl {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 7px;
    font-weight: 900;
    background: #f39c12;
    color: #000;
    text-align: center;
    line-height: 1.4;
}

/* --- Owned Power-Ups --- */
.cr-owned-pu-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: rgba(142,68,173,0.06);
    border: 1px solid rgba(142,68,173,0.15);
    border-radius: 8px;
}
.cr-owned-pu {
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #2a1550, #1a0e30);
    border: 1px solid rgba(142,68,173,0.3);
    border-radius: 5px;
    padding: 8px 10px;
    font-size: 11px;
    cursor: pointer;
    min-height: 36px;
    position: relative;
    z-index: 1;
}
.cr-owned-pu-icon { font-size: 14px; }
.cr-owned-pu-name { color: #bbb; flex: 1; }
.cr-owned-pu-sell {
    font-size: 10px;
    color: #fff;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(231,76,60,0.5);
    background: rgba(231,76,60,0.3);
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 4px;
}
.cr-owned-pu-sell:hover { background: rgba(231,76,60,0.5); border-color: #e74c3c; transform: scale(1.05); }
.cr-owned-pu-sell:active { background: rgba(231,76,60,0.7); transform: scale(0.95); }
.cr-owned-pu.negative { border-left-color: #9b59b6 !important; opacity: 0.85; }
.cr-owned-pu.foil {
    border-image: linear-gradient(135deg, gold, #ff6b6b, #48dbfb, gold) 1;
}

/* Foil shop card */
.cr-shop-card.foil {
    border: 2px solid gold !important;
    box-shadow: 0 0 12px rgba(255,215,0,0.4), inset 0 0 20px rgba(255,215,0,0.08);
}
.cr-shop-card.foil::before {
    content: '✦ FOIL';
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 7px;
    font-weight: 900;
    color: gold;
    text-shadow: 0 0 4px rgba(255,215,0,0.6);
}

/* Negative shop card */
.cr-shop-card.negative {
    border: 1.5px solid rgba(155,89,182,0.5) !important;
    background: rgba(155,89,182,0.08) !important;
}
.cr-shop-card.negative .cr-shop-pu-desc { color: #e74c3c; }

/* === GAME OVER / VICTORY === */

.cr-gameover-screen, .cr-victory-screen {
    justify-content: center;
    text-align: center;
}

.cr-gameover-title {
    font-size: 28px;
    color: #e74c3c;
    margin: 0 0 6px 0;
}

.cr-gameover-sub {
    font-size: 14px;
    color: #888;
    margin: 0 0 16px 0;
}

.cr-victory-title {
    font-size: 28px;
    margin: 0 0 10px 0;
    background: linear-gradient(to bottom, #f1c40f, #e67e22);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cr-victory-crowns {
    font-size: 24px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.cr-gameover-stats {
    width: 100%;
    max-width: 300px;
    margin-bottom: 16px;
}

.cr-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cr-stat-row span:last-child {
    font-weight: bold;
    color: #f1c40f;
}

/* === NEW UNIT EFFECTS IN LANGUAGE CLASH === */

.clash-unit.raged .clash-unit-icon {
    filter: hue-rotate(300deg) saturate(2) brightness(1.3);
}

.clash-unit.slowed .clash-unit-icon {
    filter: hue-rotate(180deg) saturate(0.5) brightness(0.8);
}

.clash-unit.frozen {
    opacity: 0.6;
}

.clash-unit.frozen .clash-unit-icon {
    filter: hue-rotate(180deg) brightness(1.5) saturate(0.3);
}

.clash-poison-zone {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100,0,200,0.3) 0%, rgba(50,0,100,0.1) 100%);
    border: 1px solid rgba(150,0,255,0.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: cr-poison-pulse 2s ease-in-out infinite;
    z-index: 5;
}

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

.clash-spell-effect.rage-effect {
    background: radial-gradient(circle, rgba(200,0,255,0.6) 0%, rgba(200,0,255,0.1) 100%) !important;
}

.clash-spell-effect.freeze-effect {
    background: radial-gradient(circle, rgba(100,200,255,0.7) 0%, rgba(100,200,255,0.1) 100%) !important;
    animation: cr-freeze-linger 0.5s ease-out;
}

@keyframes cr-freeze-linger {
    0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* (sell cards and upgrade card styles are in the shop section above) */

/* === FREE TAG === */

.cr-free-tag {
    color: #2ecc71;
    font-weight: bold;
    animation: cr-free-pulse 1s ease-in-out infinite;
}

@keyframes cr-free-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === LEVEL BADGE === */

.cr-lvl-badge {
    font-size: 9px;
    background: #f39c12;
    color: #000;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 2px;
    font-weight: bold;
}

/* === HANDICAP / CHALLENGE SCREEN === */

.cr-handicap-screen {
    justify-content: center;
    text-align: center;
}

.cr-handicap-title {
    font-size: 24px;
    color: #f1c40f;
    margin: 0 0 6px 0;
    text-shadow: 0 0 12px rgba(241,196,15,0.3);
}

.cr-handicap-sub {
    font-size: 13px;
    color: #888;
    margin: 0 0 18px 0;
}

.cr-handicap-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    margin-bottom: 16px;
}

.cr-handicap-option {
    background: linear-gradient(135deg, #2a1a0a, #1a1005);
    border: 2px solid #e67e22;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.cr-handicap-option:hover {
    border-color: #f39c12;
    transform: scale(1.02);
    background: linear-gradient(135deg, #3a2a1a, #2a1a0a);
    box-shadow: 0 0 12px rgba(243,156,18,0.2);
}

.cr-handicap-option:active {
    transform: scale(0.98);
}

.cr-handicap-option.cr-gamble {
    border-color: #9b59b6;
    background: linear-gradient(135deg, #1a0a2a, #120520);
}

.cr-handicap-option.cr-gamble:hover {
    border-color: #bb6bd9;
    background: linear-gradient(135deg, #2a1a3a, #1a0a2a);
    box-shadow: 0 0 12px rgba(155,89,182,0.3);
}

.cr-handicap-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.cr-handicap-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 30px;
    text-align: center;
}

.cr-handicap-info {
    text-align: left;
    min-width: 0;
}

.cr-handicap-label {
    font-size: 13px;
    font-weight: 700;
    color: #f0e6d2;
    margin-bottom: 2px;
}

.cr-handicap-desc {
    font-size: 11px;
    color: #999;
    line-height: 1.2;
}

.cr-handicap-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.cr-handicap-reward {
    font-size: 15px;
    font-weight: 800;
    color: #2ecc71;
    white-space: nowrap;
}

.cr-gamble .cr-handicap-reward {
    color: #f1c40f;
}

.cr-gamble-tag {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #bb6bd9;
    background: rgba(155,89,182,0.2);
    border: 1px solid rgba(155,89,182,0.4);
    padding: 1px 6px;
    border-radius: 3px;
}

/* Safe area padding for mobile */
.cr-screen {
    padding-top: max(16px, env(safe-area-inset-top, 16px));
    padding-bottom: max(40px, env(safe-area-inset-bottom, 40px));
    padding-left: max(12px, env(safe-area-inset-left, 12px));
    padding-right: max(12px, env(safe-area-inset-right, 12px));
}

/* iOS Capacitor touch fixes */
.cr-btn,
.cr-starter-card,
.cr-shop-card,
.cr-sell-card,
.cr-owned-pu,
.cr-handicap-option,
.cr-map-battle {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.cr-map-list,
.cr-shop-items,
.cr-sell-grid,
.cr-deck-grid,
.cr-owned-pu-grid,
.cr-starter-grid {
    touch-action: pan-y;
}

/* === CARD TYPE TAGS === */
.cr-card-type-tag {
    display: inline-block;
    font-size: 7px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-bottom: 2px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cr-card-type-tag.melee { background: rgba(192,57,43,0.2); border: 1px solid rgba(192,57,43,0.5); color: #e74c3c; }
.cr-card-type-tag.ranged { background: rgba(41,128,185,0.2); border: 1px solid rgba(41,128,185,0.5); color: #3498db; }
.cr-card-type-tag.spell { background: rgba(142,68,173,0.2); border: 1px solid rgba(142,68,173,0.5); color: #9b59b6; }
.cr-card-type-tag.building { background: rgba(39,174,96,0.2); border: 1px solid rgba(39,174,96,0.5); color: #2ecc71; }
.cr-card-type-tag.swarm { background: rgba(243,156,18,0.2); border: 1px solid rgba(243,156,18,0.5); color: #f1c40f; }

/* === RANDOM EVENT SCREEN === */
.cr-event-screen {
    justify-content: center;
    text-align: center;
}
.cr-event-title {
    font-size: 22px;
    color: #f1c40f;
    margin: 0 0 4px 0;
}
.cr-event-icon {
    font-size: 48px;
    margin: 10px 0;
}
.cr-event-desc {
    font-size: 14px;
    color: #ddd;
    margin-bottom: 16px;
    max-width: 300px;
}
.cr-event-reward {
    font-size: 15px;
    font-weight: bold;
    color: #2ecc71;
    margin-bottom: 16px;
}
.cr-event-cards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 12px;
}

/* === BOSS BATTLE LABELS === */
.cr-map-stage.boss {
    color: #e74c3c;
    font-weight: 900;
}
.cr-map-stage.mini-boss {
    color: #e67e22;
    font-weight: 900;
}

/* === VICTORY CELEBRATION === */
@keyframes confettiFall {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0.3; }
}
.cr-confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999999;
    overflow: hidden;
}
.cr-confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 1px;
    animation: confettiFall linear forwards;
}

.cr-journey-recap {
    width: 100%;
    max-width: 340px;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cr-recap-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    font-size: 12px;
}
.cr-recap-num {
    font-weight: bold;
    color: #f1c40f;
    width: 20px;
    text-align: center;
}
.cr-recap-crowns {
    flex: 1;
    text-align: right;
}
.cr-final-build {
    width: 100%;
    max-width: 340px;
    margin: 8px 0;
    padding: 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
}
.cr-final-build h4 {
    margin: 0 0 6px 0;
    color: #f1c40f;
    font-size: 13px;
}
.cr-final-deck-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.cr-final-pu-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* === MINI SPRITE IN CARD TAGS === */
.cr-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cr-card-tag-icon {
    width: 18px;
    height: 18px;
    image-rendering: auto;
    vertical-align: middle;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}

/* === PURCHASE FLASH === */
@keyframes cr-purchaseFlash {
    0% { box-shadow: 0 0 0 0 rgba(241,196,15,0.8); }
    50% { box-shadow: 0 0 20px 4px rgba(241,196,15,0.6); transform: scale(1.06); }
    100% { box-shadow: 0 0 0 0 rgba(241,196,15,0); transform: scale(1); }
}
.cr-purchase-flash {
    animation: cr-purchaseFlash 0.4s ease-out !important;
}

/* === FLOATING GOLD TEXT === */
@keyframes cr-floatUp {
    0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
    20% { opacity: 1; transform: translate(-50%, -8px) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -30px) scale(0.8); }
}
.cr-float-gold {
    position: absolute;
    font-size: 14px;
    font-weight: 900;
    pointer-events: none;
    z-index: 100;
    left: 50%;
    top: -10px;
    white-space: nowrap;
    text-shadow: 1px 1px 2px #000;
    animation: cr-floatUp 0.9s ease-out forwards;
}
.cr-float-gold.spend { color: #e74c3c; }
.cr-float-gold.gain { color: #2ecc71; }

/* === GOLD BUMP === */
@keyframes cr-goldBump {
    0% { transform: scale(1); }
    30% { transform: scale(1.25); }
    100% { transform: scale(1); }
}
.cr-gold-bump {
    animation: cr-goldBump 0.35s ease-out;
}

/* === CARD FLIP OUT (REROLL) === */
@keyframes cr-flipOut {
    0% { opacity: 1; transform: perspective(400px) rotateY(0deg) scale(1); }
    100% { opacity: 0; transform: perspective(400px) rotateY(90deg) scale(0.8); }
}
.cr-card-flip-out {
    animation: cr-flipOut 0.3s ease-in forwards;
}

/* === SCREEN TRANSITIONS === */
@keyframes cr-screenEnter {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}
.cr-screen {
    animation: cr-screenEnter 0.25s ease-out;
}
.cr-screen-exit {
    animation: cr-screenEnter 0.2s ease-in reverse forwards;
}

.cr-fade-out {
    transition: opacity 0.25s ease;
    opacity: 0 !important;
}

/* === AMBIENT EMBERS === */
@keyframes cr-emberFloat {
    0% { transform: translateY(100vh) translateX(0) scale(0); opacity: 0; }
    10% { opacity: 1; transform: translateY(90vh) translateX(-5px) scale(1); }
    50% { transform: translateY(50vh) translateX(10px) scale(0.8); }
    90% { opacity: 0.3; }
    100% { transform: translateY(-5vh) translateX(-8px) scale(0.3); opacity: 0; }
}
.cr-embers-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.cr-ember {
    position: absolute;
    bottom: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #f39c12, #e74c3c);
    animation: cr-emberFloat linear infinite;
    box-shadow: 0 0 4px 1px rgba(243,156,18,0.4);
}

/* === SHOP TOOLTIP === */
.cr-tooltip-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999990;
    background: rgba(0,0,0,0.5);
    animation: cr-tooltipFadeIn 0.15s ease-out;
}
.cr-shop-tooltip {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999991;
    background: linear-gradient(160deg, #1e3050, #101a28);
    border: 2px solid #f1c40f;
    border-radius: 14px;
    padding: 18px 16px 14px;
    width: min(280px, 85vw);
    box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 20px rgba(241,196,15,0.15);
    color: #ecf0f1;
    animation: cr-tooltipPop 0.2s ease-out;
}
.cr-shop-tooltip.powerup-tooltip {
    border-color: #d252ff;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 20px rgba(210,82,255,0.15);
}
.cr-shop-tooltip.negative-tooltip {
    border-color: #9b59b6;
}
@keyframes cr-tooltipPop {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes cr-tooltipFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
.cr-tt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.cr-tt-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}
.cr-tt-sprite {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.cr-tt-title-block {
    flex: 1;
    min-width: 0;
}
.cr-tt-name {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin: 0;
}
.cr-tt-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-top: 2px;
}
.cr-tt-rarity {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    margin-top: 3px;
}
.cr-tt-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.12), transparent);
    margin: 8px 0;
}
.cr-tt-desc {
    font-size: 13px;
    line-height: 1.5;
    color: #bdc3c7;
    margin-bottom: 8px;
}
.cr-tt-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.cr-tt-stat {
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 4px 8px;
    text-align: center;
    flex: 1;
    min-width: 50px;
}
.cr-tt-stat-val {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #f1c40f;
}
.cr-tt-stat-lbl {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cr-tt-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s, filter 0.1s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.cr-tt-buy:active {
    transform: scale(0.96);
    filter: brightness(0.9);
}
.cr-tt-buy.disabled {
    background: #333;
    color: #666;
    pointer-events: none;
}
.cr-tt-buy .cr-coin-sm {
    width: 16px;
    height: 16px;
}
.cr-tt-hint {
    text-align: center;
    font-size: 10px;
    color: #555;
    margin-top: 8px;
}
.cr-shop-card.tt-selected {
    border-color: #f1c40f !important;
    box-shadow: 0 0 14px rgba(241,196,15,0.3);
    transform: translateY(-3px) scale(1.03);
}
.cr-shop-card.powerup.tt-selected {
    border-color: #d252ff !important;
    box-shadow: 0 0 14px rgba(210,82,255,0.3);
}

/* === FORCED DRAFT SCREEN === */
.cr-draft-screen {
    text-align: center;
}
.cr-draft-title {
    font-size: 22px;
    color: #f1c40f;
    margin: 0 0 6px 0;
    text-shadow: 0 2px 8px rgba(241,196,15,0.3);
}
.cr-draft-sub {
    font-size: 13px;
    color: #bbb;
    margin: 0 0 10px 0;
    line-height: 1.4;
}
.cr-draft-sub strong {
    color: #fff;
}
.cr-draft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 8px 0 16px;
}
.cr-draft-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #333;
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    text-align: center;
}
.cr-draft-card:hover {
    border-color: #555;
    transform: translateY(-2px);
}
.cr-draft-card.selected {
    border-color: #2ecc71;
    background: linear-gradient(135deg, #1a2e1a 0%, #163e2e 100%);
    box-shadow: 0 0 12px rgba(46,204,113,0.3);
}
.cr-draft-card-img {
    width: 48px;
    height: 48px;
    margin: 0 auto 6px;
}
.cr-draft-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: auto;
}
.cr-draft-card-name {
    font-size: 12px;
    font-weight: bold;
    color: #eee;
    margin-bottom: 2px;
}
.cr-draft-card-cost {
    font-size: 11px;
    color: #9b59b6;
    margin-bottom: 4px;
}
.cr-draft-card-desc {
    font-size: 10px;
    color: #888;
    line-height: 1.3;
    min-height: 26px;
}
.cr-draft-card-tag {
    font-size: 10px;
    color: #2ecc71;
    font-weight: bold;
    margin-top: 4px;
}
.cr-draft-check {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #2ecc71;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}
.cr-draft-warning {
    background: rgba(241,196,15,0.15);
    border: 1px solid rgba(241,196,15,0.4);
    color: #f1c40f;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 8px;
    text-align: center;
}
.cr-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === ACT HEADERS & SEPARATOR === */

.cr-act-header-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(241,196,15,0.12) 0%, rgba(231,76,60,0.08) 100%);
    border: 2px solid rgba(241,196,15,0.3);
    border-radius: 12px;
    margin-bottom: 4px;
}
.cr-act-header-card.locked {
    opacity: 0.3;
    border-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
}
.cr-act-numeral {
    font-size: 32px;
    font-weight: 900;
    color: #f1c40f;
    line-height: 1;
    text-shadow: 0 0 12px rgba(241,196,15,0.4);
    min-width: 36px;
    text-align: center;
}
.cr-act-header-card.locked .cr-act-numeral {
    color: #555;
    text-shadow: none;
}
.cr-act-label {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #f1c40f;
    text-transform: uppercase;
}
.cr-act-header-card.locked .cr-act-label {
    color: #555;
}
.cr-act-name {
    font-size: 11px;
    color: #8e8e8e;
    margin-top: 2px;
    font-style: italic;
}

.cr-act-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    margin: 4px 0;
}
.cr-act-sep-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(241,196,15,0.4), transparent);
}
.cr-act-reward-badge {
    font-size: 11px;
    font-weight: 700;
    color: #f1c40f;
    padding: 5px 14px;
    border: 1.5px solid rgba(241,196,15,0.4);
    border-radius: 20px;
    background: rgba(241,196,15,0.08);
    white-space: nowrap;
    letter-spacing: 0.5px;
}
.cr-act-reward-badge.earned {
    background: rgba(241,196,15,0.15);
    box-shadow: 0 0 12px rgba(241,196,15,0.15);
}
.cr-act-reward-badge.locked {
    color: #555;
    border-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
}

.cr-map-stage.act-boss {
    color: #f1c40f;
    font-weight: 900;
    text-shadow: 0 0 8px rgba(241,196,15,0.4);
}

/* === ACT COMPLETE BANNER === */

.cr-act-complete-banner {
    font-size: 18px;
    font-weight: 900;
    color: #f1c40f;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 8px 0;
    text-shadow: 0 0 12px rgba(241,196,15,0.5);
    animation: cr-act-banner-pulse 1.5s ease-in-out infinite;
}
@keyframes cr-act-banner-pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 12px rgba(241,196,15,0.5); }
    50% { opacity: 0.8; text-shadow: 0 0 24px rgba(241,196,15,0.8); }
}

.cr-btn-act-reward {
    background: linear-gradient(to bottom, #f1c40f, #d4ac0d);
    border-color: #f9e547;
    color: #1a1a2e;
    font-size: 18px;
    padding: 14px 32px;
    animation: cr-pulse-gold 1.5s infinite;
    text-shadow: none;
}
@keyframes cr-pulse-gold {
    0%, 100% { box-shadow: 0 0 10px rgba(241,196,15,0.4); }
    50% { box-shadow: 0 0 30px rgba(241,196,15,0.8); }
}

/* === ACT REWARD SCREEN === */

.cr-act-reward-screen {
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cr-act-reward-glow {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(241,196,15,0.12) 0%, transparent 70%);
    pointer-events: none;
    animation: cr-reward-glow-pulse 3s ease-in-out infinite;
}
@keyframes cr-reward-glow-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.6; }
    50% { transform: translateX(-50%) scale(1.2); opacity: 1; }
}
.cr-act-reward-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 4px;
    margin: 0 0 4px 0;
    background: linear-gradient(to bottom, #f9e547, #d4ac0d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    position: relative;
    z-index: 1;
}
.cr-act-reward-sub {
    font-size: 13px;
    color: #8e8e8e;
    margin: 0 0 20px 0;
    position: relative;
    z-index: 1;
}

.cr-act-reward-grid {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.cr-act-reward-card {
    flex: 1;
    min-width: 110px;
    max-width: 140px;
    background: linear-gradient(160deg, #1a2a3d, #0f1925);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 16px 10px 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.cr-act-reward-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.04), transparent 40%);
    pointer-events: none;
    border-radius: 12px;
}
.cr-act-reward-card:hover {
    transform: translateY(-6px) scale(1.04);
    border-color: var(--reward-color, #f1c40f);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 20px color-mix(in srgb, var(--reward-color, #f1c40f) 30%, transparent);
}
.cr-act-reward-card:active {
    transform: translateY(-2px) scale(0.98);
}

.cr-act-reward-svg {
    width: 90px;
    height: 90px;
    margin: 0 auto 10px;
}
.cr-act-reward-svg svg {
    width: 100%;
    height: 100%;
}

.cr-act-reward-name {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.cr-act-reward-desc {
    font-size: 10px;
    color: #8e8e8e;
    line-height: 1.4;
}

.cr-act-reward-chosen {
    border-color: #f1c40f !important;
    box-shadow: 0 0 30px rgba(241,196,15,0.5) !important;
    transform: scale(1.08) !important;
    animation: cr-reward-pick 0.5s ease-out;
}
.cr-act-reward-unchosen {
    opacity: 0.15;
    transform: scale(0.9);
    pointer-events: none;
    filter: grayscale(0.8);
}
@keyframes cr-reward-pick {
    0% { transform: scale(1); }
    40% { transform: scale(1.15); }
    100% { transform: scale(1.08); }
}

/* === ACT REWARD CONFIRM === */

.cr-act-reward-confirm {
    justify-content: center;
    text-align: center;
}
.cr-act-reward-chosen-name {
    font-size: 22px;
    font-weight: 900;
    margin: 0 0 8px 0;
    letter-spacing: 1px;
}
.cr-act-reward-chosen-desc {
    font-size: 14px;
    color: #bbb;
    margin: 0 0 12px 0;
    max-width: 280px;
    line-height: 1.5;
}
.cr-act-reward-bonus {
    font-size: 15px;
    font-weight: 700;
    color: #2ecc71;
    margin-bottom: 16px;
    animation: cr-free-pulse 1s ease-in-out infinite;
}

.cr-recap-act-label {
    font-size: 10px;
    font-weight: 800;
    color: #f1c40f;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 2px 0;
    opacity: 0.7;
}

/* === BOUNTY BOARD === */
.cr-bounty-board {
    width: 100%;
    max-width: 420px;
    margin-top: 16px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(46,204,113,0.08), rgba(39,174,96,0.04));
    border: 1px solid rgba(46,204,113,0.2);
    border-radius: 10px;
}
.cr-bounty-header {
    font-size: 11px;
    font-weight: 700;
    color: #2ecc71;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
}
.cr-bounty-icon { margin-right: 4px; }
.cr-bounty-hint {
    font-size: 9px;
    font-weight: 400;
    color: #7f8c8d;
    text-transform: none;
    letter-spacing: 0;
}
.cr-bounty-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cr-bounty-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid rgba(46,204,113,0.15);
}
.cr-bounty-item-icon { font-size: 16px; flex-shrink: 0; }
.cr-bounty-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.cr-bounty-label {
    font-size: 12px;
    font-weight: 700;
    color: #ecf0f1;
}
.cr-bounty-desc {
    font-size: 10px;
    color: #95a5a6;
}
.cr-bounty-reward {
    font-size: 13px;
    font-weight: 800;
    color: #2ecc71;
    flex-shrink: 0;
}

/* === LEARN & EARN === */
.cr-learn-earn-section {
    text-align: center;
}
.cr-btn-learn-earn {
    background: linear-gradient(135deg, #2980b9, #3498db) !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 10px 20px !important;
    border: 1.5px solid rgba(52,152,219,0.5) !important;
    border-radius: 10px !important;
    cursor: pointer;
    transition: all 0.2s;
    animation: cr-le-pulse 2s ease-in-out infinite;
}
.cr-btn-learn-earn:hover {
    background: linear-gradient(135deg, #3498db, #5dade2) !important;
    transform: scale(1.03);
}
@keyframes cr-le-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52,152,219,0.4); }
    50% { box-shadow: 0 0 12px 4px rgba(52,152,219,0.25); }
}
.cr-learn-earn-done {
    font-size: 13px;
    font-weight: 700;
    color: #2ecc71;
    padding: 8px 0;
}

/* Learn & Earn Overlay */
.cr-le-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: cr-le-fadein 0.3s ease-out;
}
@keyframes cr-le-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}
.cr-le-modal {
    background: linear-gradient(160deg, #1a1a2e, #16213e);
    border: 1.5px solid rgba(52,152,219,0.3);
    border-radius: 16px;
    padding: 20px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.cr-le-title {
    font-size: 20px;
    font-weight: 900;
    color: #f1c40f;
    margin: 0 0 6px 0;
    letter-spacing: 1px;
}
.cr-le-sub {
    font-size: 12px;
    color: #95a5a6;
    margin: 0 0 12px 0;
}
.cr-le-timer {
    font-size: 18px;
    font-weight: 800;
    color: #e74c3c;
    margin-bottom: 12px;
}

/* Speed Match Board */
.cr-le-board {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.cr-le-left, .cr-le-right {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.cr-le-word {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #ecf0f1;
    text-align: center;
}
.cr-le-word:hover:not(.matched) {
    border-color: #3498db;
    background: rgba(52,152,219,0.15);
    transform: scale(1.04);
}
.cr-le-word.selected {
    border-color: #f1c40f;
    background: rgba(241,196,15,0.2);
    box-shadow: 0 0 8px rgba(241,196,15,0.3);
}
.cr-le-word.matched {
    opacity: 0.25;
    pointer-events: none;
    border-color: #2ecc71;
    background: rgba(46,204,113,0.1);
    text-decoration: line-through;
}
.cr-le-word.wrong-flash {
    border-color: #e74c3c;
    background: rgba(231,76,60,0.25);
    animation: cr-le-wrong-shake 0.4s ease-out;
    pointer-events: none;
}
.cr-le-word.correct-hint {
    border-color: #2ecc71;
    background: rgba(46,204,113,0.25);
    box-shadow: 0 0 10px rgba(46,204,113,0.4);
    pointer-events: none;
}
@keyframes cr-le-wrong-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}
.cr-le-answer-reveal {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(46,204,113,0.1);
    border: 1px solid rgba(46,204,113,0.3);
    border-radius: 8px;
    font-size: 13px;
    color: #2ecc71;
    font-weight: 600;
    animation: cr-le-fadein 0.2s ease-out;
}

/* Rapid Fire */
.cr-le-rf-progress {
    font-size: 11px;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 4px;
}
.cr-le-rf-score {
    font-size: 15px;
    font-weight: 800;
    color: #f1c40f;
    margin-bottom: 12px;
}
.cr-le-streak {
    color: #e74c3c;
    font-size: 13px;
    animation: cr-le-streak-pulse 0.5s ease-in-out;
}
@keyframes cr-le-streak-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.cr-le-rf-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 16px 12px;
    margin: 0 auto 14px auto;
    max-width: 260px;
    animation: cr-le-card-in 0.25s ease-out;
}
@keyframes cr-le-card-in {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.cr-le-rf-foreign {
    font-size: 20px;
    font-weight: 800;
    color: #ecf0f1;
    margin-bottom: 4px;
}
.cr-le-rf-arrow {
    font-size: 14px;
    color: #7f8c8d;
    margin: 4px 0;
}
.cr-le-rf-translation {
    font-size: 16px;
    font-weight: 600;
    color: #bdc3c7;
}
.cr-le-rf-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.cr-le-rf-wrong {
    background: linear-gradient(135deg, #c0392b, #e74c3c) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    padding: 10px 24px !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer;
    flex: 1;
    max-width: 120px;
}
.cr-le-rf-correct {
    background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    padding: 10px 24px !important;
    border-radius: 10px !important;
    border: none !important;
    cursor: pointer;
    flex: 1;
    max-width: 120px;
}
.cr-le-rf-wrong:active { transform: scale(0.95); }
.cr-le-rf-correct:active { transform: scale(0.95); }

/* Learn & Earn Results */
.cr-le-results {
    margin: 16px 0;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
}
.cr-le-result-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: #bdc3c7;
}
.cr-le-result-row.total {
    font-size: 15px;
    font-weight: 800;
    color: #ecf0f1;
}
.cr-le-result-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 6px 0;
}

