* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: #0a1a0a;
    font-family: 'Lora', Georgia, serif;
    color: #faf3e0;
    -webkit-user-select: none;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Small Screen Prompt (phones in any orientation) */
#small-screen-prompt {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #0a1a0a;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    color: #faf3e0;
    font-family: 'Cinzel', serif;
    text-align: center;
    padding: 40px;
}

#small-screen-prompt h2 {
    color: #c9a84c;
    font-size: 1.4rem;
    letter-spacing: 1px;
}

#small-screen-prompt p {
    color: rgba(250, 243, 224, 0.5);
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    line-height: 1.6;
}

.phone-icon-box {
    font-size: 3rem;
    opacity: 0.7;
}

/* Phones only: touch device with small viewport */
@media (pointer: coarse) and (max-width: 600px),
       (pointer: coarse) and (max-height: 440px) {
    #small-screen-prompt { display: flex; }
    #game-container { display: none; }
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 26, 10, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-card {
    text-align: center;
    padding: 40px 60px;
    background: rgba(30, 50, 30, 0.9);
    border: 2px solid #c9a84c;
    border-radius: 12px;
}

.loading-card h2 {
    font-family: 'Cinzel', serif;
    color: #c9a84c;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.loading-bar {
    width: 240px;
    height: 8px;
    background: rgba(250, 243, 224, 0.15);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 10px;
}

.loading-fill {
    height: 100%;
    background: #c9a84c;
    border-radius: 4px;
    transition: width 0.2s;
}

.loading-card p {
    color: rgba(250, 243, 224, 0.5);
    font-size: 0.85rem;
}

/* Player Select Overlay */
.player-select-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 26, 10, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
}

.select-card {
    text-align: center;
    padding: 50px 60px;
    background: linear-gradient(145deg, rgba(30, 50, 30, 0.95), rgba(20, 35, 20, 0.95));
    border: 2px solid #c9a84c;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.select-card h2 {
    font-family: 'Cinzel', serif;
    color: #c9a84c;
    font-size: 2rem;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.select-card > p {
    color: rgba(250, 243, 224, 0.6);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.select-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 20px;
}

.select-buttons button {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 14px 28px;
    background: rgba(201, 168, 76, 0.15);
    border: 2px solid #c9a84c;
    color: #c9a84c;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.03em;
}

.select-buttons button:hover {
    background: #c9a84c;
    color: #1a3a1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 168, 76, 0.3);
}

.select-sub {
    color: rgba(250, 243, 224, 0.35);
    font-size: 0.85rem;
}

.opponent-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 20px;
}

.opponent-list li {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: #c9a84c;
    padding: 6px 0;
    letter-spacing: 0.5px;
}

.begin-hunt-btn {
    font-size: 1.05rem !important;
    padding: 14px 36px !important;
    letter-spacing: 1px;
}

/* Tutorial Banner - top center, above the piles */
.tutorial-banner {
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 50, 30, 0.95);
    border: 1px solid rgba(201, 168, 76, 0.6);
    border-radius: 8px;
    padding: 12px 28px;
    max-width: 420px;
    text-align: center;
    font-size: 0.95rem;
    color: #faf3e0;
    z-index: 50;
    animation: tutorialFadeIn 0.3s ease;
    pointer-events: none;
}

@keyframes tutorialFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Action Log - compact bottom-left, below hand cards */
.action-log {
    position: absolute;
    bottom: 2px;
    left: 8px;
    width: 220px;
    max-height: 48px;
    overflow: hidden;
    z-index: 40;
    pointer-events: none;
    background: rgba(10, 26, 10, 0.4);
    border-radius: 4px;
    padding: 4px 4px;
}

.log-entry {
    font-size: 0.7rem;
    color: rgba(250, 243, 224, 0.5);
    padding: 1px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: logFade 0.3s ease;
}

.log-entry:last-child {
    color: rgba(250, 243, 224, 0.85);
}

@keyframes logFade {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Game Over Overlay */
.game-over-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 26, 10, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 80;
}

.gameover-card {
    text-align: center;
    padding: 40px 50px;
    background: linear-gradient(145deg, rgba(30, 50, 30, 0.95), rgba(20, 35, 20, 0.95));
    border: 2px solid #c9a84c;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    min-width: 320px;
}

.gameover-card h2 {
    font-family: 'Cinzel', serif;
    color: #c9a84c;
    font-size: 2rem;
    margin-bottom: 8px;
}

.gameover-sub {
    color: rgba(250, 243, 224, 0.6);
    margin-bottom: 24px;
}

.gameover-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.gameover-stats div {
    background: rgba(250, 243, 224, 0.06);
    padding: 10px;
    border-radius: 6px;
}

.gameover-stats span {
    display: block;
    font-size: 0.75rem;
    color: rgba(250, 243, 224, 0.45);
    margin-bottom: 4px;
}

.gameover-stats strong {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: #c9a84c;
}

.replay-btn {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 12px 36px;
    background: #c9a84c;
    border: none;
    color: #1a3a1a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.03em;
}

.replay-btn:hover {
    background: #dfc575;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 168, 76, 0.4);
}

/* Scoreboard Overlay */
.scoreboard-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 26, 10, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 85;
}

.scoreboard-card {
    text-align: center;
    padding: 40px 50px;
    background: linear-gradient(145deg, rgba(30, 50, 30, 0.95), rgba(20, 35, 20, 0.95));
    border: 2px solid #c9a84c;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    min-width: 340px;
    max-width: 420px;
}

.scoreboard-card h2 {
    font-family: 'Cinzel', serif;
    color: #c9a84c;
    font-size: 1.8rem;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.scoreboard-result {
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: 8px;
    background: rgba(250, 243, 224, 0.04);
}

.scoreboard-result h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.scoreboard-result.result-win h3 { color: #4CAF50; }
.scoreboard-result.result-loss h3 { color: #b33030; }

.scoreboard-result p {
    color: rgba(250, 243, 224, 0.5);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.scoreboard-game-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.scoreboard-game-stats span {
    color: rgba(250, 243, 224, 0.4);
    font-size: 0.8rem;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-family: 'Lora', serif;
    font-size: 0.9rem;
}

.leaderboard-table thead th {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: rgba(250, 243, 224, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 8px 8px;
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
    text-align: center;
}

.leaderboard-table thead th:nth-child(2) {
    text-align: left;
}

.leaderboard-table tbody td {
    padding: 8px 8px;
    color: rgba(250, 243, 224, 0.6);
    text-align: center;
    border-bottom: 1px solid rgba(250, 243, 224, 0.05);
}

.leaderboard-table tbody td:nth-child(1) {
    font-family: 'Cinzel', serif;
    color: rgba(201, 168, 76, 0.5);
    font-size: 0.85rem;
    width: 28px;
}

.leaderboard-table tbody td:nth-child(2) {
    text-align: left;
    font-weight: 700;
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tbody tr.leaderboard-you td {
    color: #c9a84c;
}

.leaderboard-table tbody tr.leaderboard-you td:nth-child(2) {
    font-family: 'Cinzel', serif;
}

.scoreboard-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scoreboard-play-btn {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 14px 36px;
    background: #c9a84c;
    border: none;
    color: #1a3a1a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.03em;
}

.scoreboard-play-btn:hover {
    background: #dfc575;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 168, 76, 0.4);
}

.scoreboard-leave-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 24px;
    background: transparent;
    border: 1px solid rgba(250, 243, 224, 0.2);
    color: rgba(250, 243, 224, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.scoreboard-leave-btn:hover {
    border-color: rgba(250, 243, 224, 0.4);
    color: rgba(250, 243, 224, 0.8);
}

/* Discard / Cancel Buttons */
.discard-btn, .cancel-btn {
    position: absolute;
    z-index: 60;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.discard-btn {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(139, 26, 26, 0.7);
    border: 1px solid #b33030;
    color: #faf3e0;
}

.discard-btn:hover {
    background: #b33030;
}

.cancel-btn {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(250, 243, 224, 0.1);
    border: 1px solid rgba(250, 243, 224, 0.3);
    color: #faf3e0;
}

.cancel-btn:hover {
    background: rgba(250, 243, 224, 0.2);
}

/* ===== Action Panel ===== */
.action-panel {
    position: absolute;
    z-index: 58;
    text-align: center;
    pointer-events: none;
}

.action-prompt {
    font-family: 'Lora', serif;
    font-size: 0.88rem;
    color: rgba(250, 243, 224, 0.85);
    margin-bottom: 10px;
    padding: 8px 14px;
    background: rgba(10, 26, 10, 0.92);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 8px;
    line-height: 1.4;
}

.action-prompt.alert {
    color: #c9a84c;
    border-color: rgba(201, 168, 76, 0.6);
    background: rgba(30, 50, 30, 0.95);
}

.action-prompt.ai-narration {
    color: rgba(250, 243, 224, 0.5);
    font-style: italic;
    border-color: rgba(250, 243, 224, 0.1);
}

.action-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    pointer-events: auto;
}

.action-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.action-btn.primary {
    background: rgba(201, 168, 76, 0.18);
    border: 2px solid #c9a84c;
    color: #c9a84c;
}

.action-btn.primary:hover {
    background: #c9a84c;
    color: #1a3a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(201, 168, 76, 0.3);
}

.action-btn.danger {
    background: rgba(139, 26, 26, 0.18);
    border: 1px solid rgba(179, 48, 48, 0.4);
    color: rgba(250, 243, 224, 0.55);
}

.action-btn.danger:hover {
    background: rgba(139, 26, 26, 0.5);
    color: #faf3e0;
}

.action-btn.secondary {
    background: rgba(250, 243, 224, 0.06);
    border: 1px solid rgba(250, 243, 224, 0.2);
    color: rgba(250, 243, 224, 0.6);
}

.action-btn.secondary:hover {
    background: rgba(250, 243, 224, 0.12);
    color: #faf3e0;
    transform: translateY(-1px);
}

/* Scrollbar */
.action-log::-webkit-scrollbar { width: 4px; }
.action-log::-webkit-scrollbar-track { background: transparent; }
.action-log::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.3); border-radius: 2px; }

/* Help Button */
.help-btn {
    position: absolute;
    z-index: 70;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(30, 50, 30, 0.85);
    border: 2px solid rgba(201, 168, 76, 0.6);
    color: #c9a84c;
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.help-btn:hover {
    background: rgba(201, 168, 76, 0.2);
    border-color: #c9a84c;
    transform: scale(1.1);
}

.login-btn {
    position: absolute;
    z-index: 70;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(30, 50, 30, 0.85);
    border: 1px solid rgba(201, 168, 76, 0.4);
    color: rgba(201, 168, 76, 0.8);
    font-family: 'Lora', serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.login-btn:hover {
    background: rgba(201, 168, 76, 0.15);
    border-color: #c9a84c;
    color: #c9a84c;
}

/* ===== How to Play Guide ===== */
.help-guide-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 26, 10, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: guideIn 0.25s ease;
}

@keyframes guideIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.help-guide-card {
    position: relative;
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 36px 40px 28px;
    background: linear-gradient(145deg, rgba(30, 50, 30, 0.97), rgba(20, 35, 20, 0.97));
    border: 2px solid #c9a84c;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.guide-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(250, 243, 224, 0.5);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.guide-close-btn:hover { color: #faf3e0; }

.guide-header {
    text-align: center;
    margin-bottom: 24px;
}

.guide-page-label {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: rgba(201, 168, 76, 0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.guide-header h2 {
    font-family: 'Cinzel', serif;
    color: #c9a84c;
    font-size: 1.6rem;
    margin-top: 4px;
    letter-spacing: 0.03em;
}

.guide-body {
    color: #faf3e0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.guide-body p { margin-bottom: 12px; }
.guide-note { color: rgba(250, 243, 224, 0.55); font-size: 0.85rem; }

.guide-species-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.guide-species {
    text-align: center;
    width: 126px;
}

.guide-species img {
    width: 110px;
    height: auto;
    border-radius: 4px;
    border: 2px solid #5c4033;
    cursor: zoom-in;
}

.guide-species span {
    display: block;
    font-size: 0.8rem;
    margin-top: 4px;
    color: rgba(250, 243, 224, 0.7);
}

.guide-species em { color: #c9a84c; font-style: normal; font-weight: 700; }

.guide-arrow {
    color: rgba(201, 168, 76, 0.5);
    font-size: 1.2rem;
    margin-top: -18px;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
}

.guide-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.guide-step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.15);
    border: 2px solid #c9a84c;
    color: #c9a84c;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-reqs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.guide-req {
    text-align: center;
}

.guide-req img {
    width: 120px;
    height: auto;
    border-radius: 4px;
    border: 2px solid #2d5016;
    cursor: zoom-in;
}

.guide-req span {
    display: block;
    font-size: 0.8rem;
    margin-top: 4px;
}

.guide-req-plus {
    color: #c9a84c;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: -14px;
}

.guide-card-types {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0;
}

.guide-type {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.guide-type-swatch {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(250, 243, 224, 0.2);
}

.guide-remedy-table {
    width: 100%;
    margin: 14px 0;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.guide-remedy-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(250, 243, 224, 0.08);
}

.guide-remedy-table td:nth-child(2) {
    text-align: center;
    color: rgba(201, 168, 76, 0.5);
    width: 30px;
}

.guide-trouble-name {
    color: #c45050;
    font-weight: 700;
}

.guide-safe-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.guide-safe-list > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guide-safe-list img {
    width: 72px;
    height: auto;
    border-radius: 4px;
    border: 2px solid #1a2e4a;
    flex-shrink: 0;
    cursor: zoom-in;
}

.guide-safe-list span { font-size: 0.9rem; }

.guide-giddyup {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
}

.guide-wild-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin: 12px 0;
}

.guide-wild-img {
    width: 140px;
    height: auto;
    border-radius: 4px;
    border: 2px solid #7a5c1f;
    flex-shrink: 0;
    cursor: zoom-in;
}

.guide-wild-section ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.guide-wild-section li {
    padding: 4px 0 4px 16px;
    position: relative;
    font-size: 0.9rem;
}

.guide-wild-section li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: #c9a84c;
}

.guide-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
}

.guide-tip {
    padding: 10px 14px;
    background: rgba(250, 243, 224, 0.04);
    border-left: 3px solid rgba(201, 168, 76, 0.4);
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
}

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

.guide-prev-btn, .guide-next-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}

.guide-prev-btn {
    background: transparent;
    border: 1px solid rgba(250, 243, 224, 0.2);
    color: rgba(250, 243, 224, 0.6);
}

.guide-prev-btn:hover {
    border-color: rgba(250, 243, 224, 0.4);
    color: #faf3e0;
}

.guide-next-btn {
    background: #c9a84c;
    border: none;
    color: #1a3a1a;
}

.guide-next-btn:hover {
    background: #dfc575;
    transform: translateY(-1px);
}

.guide-dots {
    display: flex;
    gap: 8px;
}

.guide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(250, 243, 224, 0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.guide-dot.active {
    background: #c9a84c;
    transform: scale(1.2);
}

.guide-dot:hover { background: rgba(201, 168, 76, 0.6); }

/* Guide Card Lightbox (click-to-zoom) */
.guide-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.25s ease;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.guide-lightbox.active {
    opacity: 1;
}

.guide-lightbox img {
    max-width: 90vw;
    max-height: 88vh;
    border-radius: 12px;
    box-shadow: 0 8px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.85);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.guide-lightbox.active img {
    transform: scale(1);
}

/* ===== Contextual Explainer Panel ===== */
.explainer-panel {
    position: absolute;
    top: 0;
    right: -340px;
    width: 320px;
    height: 100%;
    background: rgba(20, 35, 20, 0.97);
    border-left: 2px solid rgba(201, 168, 76, 0.4);
    z-index: 75;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -8px 0 30px rgba(0,0,0,0.4);
}

.explainer-panel.explainer-open {
    right: 0;
}

.explainer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
    flex-shrink: 0;
}

.explainer-header h3 {
    font-family: 'Cinzel', serif;
    color: #c9a84c;
    font-size: 1.1rem;
    letter-spacing: 0.03em;
}

.explainer-close {
    background: none;
    border: none;
    color: rgba(250, 243, 224, 0.5);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.explainer-close:hover { color: #faf3e0; }

.explainer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.explainer-section {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(250, 243, 224, 0.06);
}

.explainer-section:last-child { border-bottom: none; }

.explainer-section h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: rgba(201, 168, 76, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.explainer-section p {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #faf3e0;
    margin-bottom: 6px;
}

.explainer-checklist {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0;
}

.explainer-check {
    font-size: 0.85rem;
    padding: 3px 0;
}

.explainer-check.met { color: #4CAF50; }
.explainer-check.unmet { color: rgba(250, 243, 224, 0.4); }

.check-icon {
    display: inline-block;
    width: 18px;
    text-align: center;
}

.explainer-ready {
    color: #4CAF50 !important;
    font-weight: 700;
}

.explainer-blocked {
    color: #c45050 !important;
}

.explainer-trophies {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.explainer-trophy {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(250, 243, 224, 0.06);
    border-radius: 4px;
    color: rgba(250, 243, 224, 0.4);
}

.explainer-trophy.done {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.explainer-trophy.current {
    background: rgba(201, 168, 76, 0.15);
    color: #c9a84c;
    border: 1px solid rgba(201, 168, 76, 0.3);
}

.explainer-hand-card {
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(250, 243, 224, 0.03);
    border-radius: 6px;
    border-left: 3px solid rgba(250, 243, 224, 0.1);
}

.explainer-hand-card.playable {
    border-left-color: #4CAF50;
    background: rgba(76, 175, 80, 0.06);
}

.explainer-hand-card strong {
    font-size: 0.88rem;
    color: #faf3e0;
}

.card-cat {
    font-size: 0.65rem;
    padding: 1px 6px;
    border: 1px solid;
    border-radius: 3px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(250, 243, 224, 0.5);
    vertical-align: middle;
}

.explainer-hand-card p {
    font-size: 0.8rem;
    margin-top: 3px;
    color: rgba(250, 243, 224, 0.6);
    margin-bottom: 0;
}

.explainer-opponent {
    padding: 8px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(250, 243, 224, 0.04);
}

.explainer-opponent:last-child { border-bottom: none; }

.explainer-opp-trouble {
    color: #c45050;
    font-size: 0.8rem;
}

.explainer-opp-safe {
    color: #5c88c4;
    font-size: 0.8rem;
}

.explainer-opp-hunt {
    color: rgba(250, 243, 224, 0.4);
    font-size: 0.78rem;
}

.explainer-tip-section {
    background: rgba(201, 168, 76, 0.06);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-bottom: none;
}

.explainer-tip-section p {
    color: #c9a84c;
    font-size: 0.88rem;
}

.explainer-full-guide-section {
    text-align: center;
    border-bottom: none;
    padding-top: 8px;
}

.explainer-full-guide-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid rgba(201, 168, 76, 0.35);
    color: rgba(201, 168, 76, 0.7);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.03em;
}

.explainer-full-guide-btn:hover {
    background: rgba(201, 168, 76, 0.1);
    border-color: #c9a84c;
    color: #c9a84c;
}

/* Explainer body scrollbar */
.explainer-body::-webkit-scrollbar { width: 4px; }
.explainer-body::-webkit-scrollbar-track { background: transparent; }
.explainer-body::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.2); border-radius: 2px; }

/* Help guide card scrollbar */
.help-guide-card::-webkit-scrollbar { width: 6px; }
.help-guide-card::-webkit-scrollbar-track { background: transparent; }
.help-guide-card::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.3); border-radius: 3px; }

/* First-time welcome styling */
.select-learn-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 24px;
    background: transparent;
    border: 2px solid rgba(201, 168, 76, 0.5);
    color: #c9a84c;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
    display: block;
    width: 100%;
    text-align: center;
}

.select-learn-btn:hover {
    background: rgba(201, 168, 76, 0.12);
    border-color: #c9a84c;
}

.select-welcome {
    color: rgba(250, 243, 224, 0.5);
    font-size: 0.85rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .select-card { padding: 30px 24px; }
    .select-card h2 { font-size: 1.5rem; }
    .select-buttons { flex-direction: column; gap: 10px; }
    .select-buttons button { padding: 14px 24px; font-size: 1rem; min-height: 48px; }
    .tutorial-banner { max-width: 90%; font-size: 0.8rem; padding: 8px 16px; }
    .action-log { width: 140px; max-height: 60px; font-size: 0.65rem; }
    .log-entry { font-size: 0.65rem; }
    .gameover-card { padding: 28px 24px; min-width: auto; width: 90%; }
    .gameover-card h2 { font-size: 1.5rem; }
    .gameover-stats { flex-wrap: wrap; gap: 12px; }
    .discard-btn, .cancel-btn { padding: 10px 16px; font-size: 0.8rem; min-height: 44px; }
    .action-btn { padding: 10px 16px; font-size: 0.8rem; min-height: 44px; }
    .help-guide-card { padding: 28px 20px 20px; }
    .guide-header h2 { font-size: 1.3rem; }
    .guide-species img { width: 80px; }
    .guide-species { width: 96px; }
    .guide-req img { width: 90px; }
    .guide-prev-btn, .guide-next-btn { padding: 8px 16px; font-size: 0.8rem; }
    .explainer-panel { width: 280px; right: -300px; }
    .help-btn { width: 44px; height: 44px; font-size: 1.1rem; }
}

/* Very small screens */
@media (max-width: 380px) {
    .select-card { padding: 24px 18px; }
    .select-card h2 { font-size: 1.3rem; }
    .action-log { display: none; }
    .opponent-list li { font-size: 0.95rem; }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .tutorial-banner { top: 28%; font-size: 0.75rem; padding: 6px 14px; max-width: 50%; }
    .action-log { max-height: 40px; width: 120px; }
}

