/* ── Test / Board Reference Page ─────────────────────────── */

.test-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 20px 40px;
    box-sizing: border-box;
    min-height: calc(100vh - 160px);
}

/* ── BOARD ────────────────────────────────────────────────── */

.board-outer {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(4, 4, 4, 0.82);
    border: 1px solid rgba(255, 191, 0, 0.14);
    border-radius: 18px;
    padding: 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ── ZONE base ────────────────────────────────────────────── */

.zone {
    border-radius: 10px;
    border: 1px solid rgba(255, 191, 0, 0.12);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
}

.zone:hover {
    border-color: rgba(255, 191, 0, 0.5);
    box-shadow: 0 0 18px rgba(255, 191, 0, 0.15);
    background: rgba(255, 191, 0, 0.04);
}

.zone.active {
    border-color: #ffbf00;
    box-shadow: 0 0 28px rgba(255, 191, 0, 0.3);
    background: rgba(255, 191, 0, 0.07);
}

/* ── ZONE LABEL ───────────────────────────────────────────── */

.zone-label {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.52rem;
    letter-spacing: 3px;
    color: rgba(255, 191, 0, 0.35);
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
}

.zone.active .zone-label,
.zone:hover .zone-label {
    color: rgba(255, 191, 0, 0.7);
}

/* ── PLAYER LABELS ────────────────────────────────────────── */

.player-label {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.58rem;
    letter-spacing: 4px;
    color: #3a3a36;
    text-transform: uppercase;
    text-align: center;
    padding: 2px 0;
    user-select: none;
}

/* ── CARD PLACEHOLDER ─────────────────────────────────────── */

.card {
    flex-shrink: 0;
    width: 52px;
    height: 73px;
    border-radius: 5px;
    border: 1px solid rgba(255, 191, 0, 0.25);
    background: rgba(20, 18, 14, 0.9);
    pointer-events: none;
}

.card.face-down {
    background: linear-gradient(135deg, rgba(30, 25, 10, 0.95) 0%, rgba(15, 12, 5, 0.95) 100%);
    border-color: rgba(255, 191, 0, 0.2);
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(255, 191, 0, 0.04) 0px,
            rgba(255, 191, 0, 0.04) 1px,
            transparent 1px,
            transparent 8px
        );
}

.card.face-up {
    background: linear-gradient(160deg, rgba(35, 30, 12, 0.95) 0%, rgba(18, 14, 4, 0.95) 100%);
    border-color: rgba(255, 191, 0, 0.45);
    box-shadow: 0 2px 8px rgba(255, 191, 0, 0.12);
}

/* deck stack effect */
.deck-stack {
    position: relative;
    width: 52px;
    height: 73px;
    flex-shrink: 0;
}

.deck-stack .card {
    position: absolute;
}

.deck-stack .card:nth-child(1) { top: 4px; left: 4px; }
.deck-stack .card:nth-child(2) { top: 2px; left: 2px; }
.deck-stack .card:nth-child(3) { top: 0;   left: 0; }

/* ── OPPONENT SECTION ─────────────────────────────────────── */

.opp-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.opp-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* ── HAND ZONES ───────────────────────────────────────────── */

.hand-zone {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    min-height: 95px;
}

.hand-zone .zone-label {
    margin-left: auto;
}

/* ── DECK ZONE ────────────────────────────────────────────── */

.deck-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    min-width: 88px;
    min-height: 95px;
}

/* ── FIELD ROW ────────────────────────────────────────────── */

.field-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    min-height: 95px;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    cursor: default !important;
}

.field-space {
    width: 60px;
    height: 84px;
    border-radius: 7px;
    border: 1px dashed rgba(255, 191, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.42rem;
    letter-spacing: 2px;
    color: rgba(255, 191, 0, 0.2);
    text-transform: uppercase;
    text-align: center;
    position: relative;
}

.field-space:hover {
    border-color: rgba(255, 191, 0, 0.5);
    border-style: solid;
    box-shadow: 0 0 14px rgba(255, 191, 0, 0.14);
    background: rgba(255, 191, 0, 0.04);
    color: rgba(255, 191, 0, 0.6);
}

.field-space.active {
    border-color: #ffbf00;
    border-style: solid;
    box-shadow: 0 0 22px rgba(255, 191, 0, 0.28);
    background: rgba(255, 191, 0, 0.07);
    color: #ffbf00;
}

/* card sitting in a field space */
.field-space .card {
    position: absolute;
    width: 52px;
    height: 73px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ── MIDDLE SECTION ───────────────────────────────────────── */

.mid-section {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
}

.loop-zone {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    min-height: 100px;
    background: rgba(255, 191, 0, 0.02);
    border-color: rgba(255, 191, 0, 0.2);
}

.loop-zone .zone-label {
    margin-left: auto;
    font-size: 0.6rem;
    letter-spacing: 5px;
}

/* cards on the loop are slightly larger */
.loop-zone .card {
    width: 58px;
    height: 81px;
}

.loop-zone .card.face-up {
    transform: rotate(-3deg);
}

.loop-zone .card.face-up:nth-child(2) {
    transform: rotate(2deg);
    margin-left: -10px;
}

.shared-column {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-shrink: 0;
    align-self: stretch;
}

/* ── GRAVEYARD & EXILE ────────────────────────────────────── */

.pile-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    min-width: 80px;
    align-self: stretch;
}

.pile-zone .card {
    width: 48px;
    height: 67px;
}

/* ── PLAYER SECTION ───────────────────────────────────────── */

.plr-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plr-bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* ── INFO PANEL ───────────────────────────────────────────── */

.info-panel {
    flex: 0 0 260px;
    background: rgba(8, 8, 8, 0.88);
    border: 1px solid rgba(255, 191, 0, 0.16);
    border-radius: 16px;
    padding: 24px 20px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky;
    top: 160px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 260px;
}

.info-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 191, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DragonSlayer', serif;
    font-size: 1.5rem;
    color: #ffbf00;
    flex-shrink: 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.info-panel.has-content .info-icon {
    border-color: #ffbf00;
    box-shadow: 0 0 18px rgba(255, 191, 0, 0.28);
}

.info-zone-name {
    font-family: 'DragonSlayer', serif;
    font-size: 1.3rem;
    color: #ffbf00;
    letter-spacing: 2px;
    margin: 0;
    line-height: 1.2;
}

.info-desc {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.82rem;
    color: rgba(240, 236, 230, 0.72);
    line-height: 1.7;
    margin: 0;
    letter-spacing: 0.3px;
}

.info-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-bullets li {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.78rem;
    color: rgba(240, 236, 230, 0.65);
    line-height: 1.5;
    padding-left: 16px;
    position: relative;
    letter-spacing: 0.3px;
}

.info-bullets li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #ffbf00;
    font-size: 0.7rem;
}

.info-hint {
    font-family: 'HwyGothic', Arial, sans-serif;
    font-size: 0.68rem;
    color: #3a3a36;
    letter-spacing: 1px;
    text-align: center;
    margin-top: auto;
}

.info-divider {
    height: 1px;
    background: rgba(255, 191, 0, 0.1);
    border: none;
    margin: 0;
}

/* ── PAGE HEADER ──────────────────────────────────────────── */

.board-page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    padding: 0 4px;
}

.board-page-title {
    font-family: 'DragonSlayer', serif;
    font-size: 1rem;
    color: rgba(255, 191, 0, 0.4);
    letter-spacing: 6px;
    margin: 0;
}

/* ── RESPONSIVE ───────────────────────────────────────────── */

@media only screen and (max-width: 900px) {
    .test-wrapper {
        flex-direction: column;
    }

    .info-panel {
        flex: none;
        width: 100%;
        position: static;
        min-height: auto;
        box-sizing: border-box;
    }
}

@media only screen and ((max-width: 767px) or (hover: none)) {
    .test-wrapper {
        padding: 12px 12px 32px;
        gap: 14px;
    }

    .board-outer {
        padding: 8px;
        gap: 4px;
    }

    .card {
        width: 30px;
        height: 42px;
    }

    .deck-stack {
        width: 30px;
        height: 42px;
    }

    .deck-stack .card:nth-child(1) { top: 3px; left: 3px; }
    .deck-stack .card:nth-child(2) { top: 1.5px; left: 1.5px; }

    .hand-zone {
        gap: 3px;
        padding: 6px 10px;
        min-height: 58px;
    }

    .deck-zone {
        min-width: 58px;
        min-height: 58px;
        padding: 6px 8px;
        gap: 5px;
    }

    .field-row {
        gap: 4px;
        padding: 6px 8px;
        min-height: 58px;
    }

    .field-space {
        width: 36px;
        height: 50px;
    }

    .field-space .card {
        width: 30px;
        height: 42px;
    }

    .mid-section {
        gap: 5px;
    }

    .loop-zone {
        gap: 5px;
        padding: 8px 10px;
        min-height: 68px;
    }

    .loop-zone .card {
        width: 34px;
        height: 48px;
    }

    .shared-column {
        gap: 4px;
    }

    .pile-zone {
        min-width: 44px;
        padding: 6px;
        gap: 4px;
    }

    .pile-zone .card {
        width: 30px;
        height: 42px;
    }
}