/*
 * A Breed Apart — premium interface system
 *
 * This file is the single consolidation layer for gameplay UI components.
 * Card artwork and established card-face assets are deliberately untouched.
 */

:root {
    --ui-font-display: 'Cormorant Garamond', Georgia, serif;
    --ui-font-text: 'Source Serif 4', Georgia, serif;

    --ui-wood-950: #130b08;
    --ui-wood-900: #1d100c;
    --ui-wood-800: #2b1912;
    --ui-wood-700: #3b2419;
    --ui-green-900: #17271f;
    --ui-green-800: #21382d;
    --ui-paper: #dfd0a8;
    --ui-paper-light: #eee2c0;
    --ui-ink: #2d2117;
    --ui-text: #eee3c7;
    --ui-text-soft: #c8ba99;
    --ui-text-muted: #9f9277;
    --ui-brass: #b88a42;
    --ui-brass-light: #d9ba73;
    --ui-rule: rgba(190, 153, 85, 0.28);
    --ui-rule-quiet: rgba(190, 153, 85, 0.14);
    --ui-success: #7fa37c;
    --ui-danger: #9b534b;
    --ui-focus: #efd58f;

    --ui-space-1: 4px;
    --ui-space-2: 8px;
    --ui-space-3: 12px;
    --ui-space-4: 16px;
    --ui-space-5: 24px;
    --ui-space-6: 32px;
    --ui-radius: 3px;
    --ui-transition: 160ms ease;
}

body {
    font-size: 16px;
    line-height: 1.45;
}

.app-container {
    width: min(100%, 1760px);
    max-width: none;
    padding: var(--ui-space-4) clamp(14px, 2vw, 32px) var(--ui-space-6);
}

header {
    min-height: 64px;
    margin-bottom: var(--ui-space-4);
    padding: var(--ui-space-2) 0 var(--ui-space-3);
    border-bottom: 1px solid var(--ui-rule);
}

header::after {
    display: none;
}

.logo-area h1 {
    font-size: clamp(2rem, 2.5vw, 2.7rem);
}

.logo-area span {
    margin-top: 5px;
    font-size: 0.76rem;
    letter-spacing: 0.15em;
}

.app-tools {
    display: flex;
    align-items: center;
    gap: var(--ui-space-3);
}

.developer-control,
.developer-dock .btn {
    color: var(--ui-text-muted) !important;
    border-color: var(--ui-rule-quiet) !important;
    background: rgba(18, 10, 7, 0.55) !important;
    box-shadow: none !important;
}

.developer-control:hover,
.developer-dock .btn:hover {
    color: var(--ui-text) !important;
    border-color: var(--ui-rule) !important;
}

.developer-dock {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    opacity: 0.68;
    transition: opacity var(--ui-transition);
}

.developer-dock:hover,
.developer-dock:focus-within {
    opacity: 1;
}

/* Shared controls */
.btn,
header .btn,
#playtestMode > .mode-columns .btn,
.shop-stats-bar .btn {
    min-height: 38px;
    padding: 8px 16px;
    color: var(--ui-text);
    border: 1px solid rgba(184, 138, 66, 0.46);
    border-radius: var(--ui-radius);
    background: linear-gradient(#4a3022, #2d1b14);
    box-shadow: inset 0 1px rgba(255, 239, 197, 0.06);
    font-family: var(--ui-font-text);
    font-size: 0.9rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    transition: background var(--ui-transition), border-color var(--ui-transition), color var(--ui-transition), transform var(--ui-transition);
}

.btn:hover,
header .btn:hover,
#playtestMode > .mode-columns .btn:hover,
.shop-stats-bar .btn:hover {
    color: #fff1c9;
    border-color: var(--ui-brass-light);
    background: linear-gradient(#5b3b29, #382117);
    transform: translateY(-1px);
}

.btn.btn-primary,
#playtestMode > .mode-columns .btn.btn-primary {
    color: #24150c;
    border: 1px solid #d9b76a;
    background: linear-gradient(#e0c681, #b98236 58%, #8b5b24);
    box-shadow: inset 0 1px rgba(255, 247, 213, 0.55), 0 2px 5px rgba(0, 0, 0, 0.3);
}

.btn.btn-danger,
#playtestMode > .mode-columns .btn.btn-danger {
    color: #d9c5b5;
    border-color: rgba(137, 72, 65, 0.55);
    background: rgba(83, 37, 34, 0.42);
    box-shadow: none;
}

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

:is(.btn, .tab-btn, .card, .trainer-icon-card, .board-slot, .board-attachment-socket):focus-visible {
    outline: 3px solid var(--ui-focus);
    outline-offset: 3px;
}

/* Main screen hierarchy */
#playtestMode > .mode-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: var(--ui-space-5);
    align-items: start;
}

#playtestMode > .mode-columns .column-main,
#playtestMode > .mode-columns .column-side {
    gap: var(--ui-space-3);
    min-width: 0;
}

#playtestMode > .mode-columns .column-side {
    width: auto;
    max-width: none;
}

#playtestMode > .mode-columns .glass-panel {
    padding: var(--ui-space-4);
    border: 1px solid var(--ui-rule-quiet);
    border-radius: var(--ui-radius);
    background: rgba(35, 21, 15, 0.72);
    box-shadow: none;
}

#playtestMode > .mode-columns .panel-title {
    min-height: 30px;
    margin-bottom: var(--ui-space-3);
    padding-bottom: var(--ui-space-2);
    color: var(--ui-text);
    border-bottom: 1px solid var(--ui-rule);
    font-family: var(--ui-font-display);
    font-size: 1.2rem;
    letter-spacing: 0.025em;
}

#playtestMode > .mode-columns .panel-title > span:first-child::before {
    display: none;
}

/* One calm status bar instead of five framed cards. */
#playtestMode .stats-hud {
    display: grid;
    grid-template-columns: 1.15fr 1.2fr 1.1fr 0.75fr 0.9fr;
    gap: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(184, 138, 66, 0.48);
    border-radius: var(--ui-radius);
    background: linear-gradient(90deg, rgba(226, 211, 172, 0.96), rgba(196, 176, 130, 0.96));
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 8px;
    z-index: 40;
}

#playtestMode .stat-card {
    min-width: 0;
    min-height: 72px;
    padding: 10px 16px;
    justify-content: center;
    border: 0;
    border-right: 1px solid rgba(82, 56, 29, 0.22);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#playtestMode .stat-card:last-child {
    border-right: 0;
}

#playtestMode .stat-card::after {
    display: none;
}

#playtestMode .stat-label {
    color: #60482e;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    line-height: 1.1;
    text-transform: none;
}

#playtestMode .stat-value,
#playtestMode .stat-value[style] {
    margin-top: 3px;
    color: #4f291f !important;
    font-family: var(--ui-font-display);
    font-size: clamp(1.6rem, 2vw, 2rem) !important;
    font-weight: 700;
    line-height: 0.95;
}

#playtestMode .stat-card--aether .stat-value {
    color: #6b531f !important;
}

#playtestMode .stat-card--grants .stat-value {
    color: #354e4a !important;
}

#playtestMode .stat-value--word {
    font-size: 1.45rem !important;
}

#playtestMode .aether-breakdown {
    gap: 4px;
    margin-top: 4px;
    font-size: 0.7rem;
}

#playtestMode .aether-breakdown span {
    padding: 0 4px;
    background: transparent;
}

/* Creature board is the main visual object. */
#playtestMode > .mode-columns .board-panel {
    padding: var(--ui-space-4) !important;
    border-color: rgba(184, 138, 66, 0.42);
    background: linear-gradient(rgba(40, 27, 19, 0.86), rgba(24, 15, 11, 0.9));
}

#playtestMode .board-panel .panel-title {
    margin-bottom: var(--ui-space-2);
    border-bottom-color: var(--ui-rule-quiet);
    font-size: 1.35rem;
}

#playtestMode .board-panel #boardScore {
    color: var(--ui-brass-light) !important;
    font-size: 0.92rem !important;
}

#playtestMode .board-play-area {
    gap: var(--ui-space-4);
    padding: var(--ui-space-4) var(--ui-space-2) var(--ui-space-2);
    border: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-color: var(--ui-brass) rgba(0, 0, 0, 0.16);
}

#playtestMode .creature-board-layout {
    gap: 16px;
    padding: 8px;
    border: 0;
    border-radius: var(--ui-radius);
    background: linear-gradient(135deg, rgba(37, 63, 50, 0.96), rgba(20, 39, 31, 0.98));
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.creature-board-layout > .board-slot,
.creature-board-layout > .board-attachment-socket {
    width: 126px;
    height: 184px;
}

#playtestMode .board-slot:not(.card) {
    border: 1px solid rgba(218, 194, 132, 0.48);
    color: #cbbd96;
    background: rgba(7, 16, 12, 0.2);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.22);
    font-size: 0.82rem;
}

#playtestMode .board-slot:not(.card) .slot-title {
    font-size: 1rem;
}

.board-attachment-socket {
    border-width: 2px;
    color: #d9ca9e;
    background: rgba(184, 138, 66, 0.1);
    font-size: 0.76rem;
}

.board-expansion-placement-prompt {
    width: min(100%, 700px);
    padding: 10px 14px;
    border-color: rgba(217, 186, 115, 0.55);
    font-size: 0.86rem;
    text-align: center;
}

.player-deck,
.player-discard {
    min-width: 138px;
    padding-top: 0;
}

/* Keep the two piles visibly distinct from the creature board they flank. */
#playtestMode .board-panel .player-deck {
    margin-right: clamp(18px, 2.5vw, 42px);
}

#playtestMode .board-panel .player-discard {
    margin-left: clamp(18px, 2.5vw, 42px);
}

.deck-stack,
.discard-stack,
.pile-placeholder {
    width: 126px;
    height: 184px;
}

.pile-placeholder {
    border: 2px dashed rgba(203, 187, 150, 0.28);
    border-radius: var(--ui-radius);
    background: rgba(8, 13, 10, 0.12);
}

.deck-stack .card-back,
.discard-top-card {
    width: 126px;
    height: 184px;
}

.deck-label,
.discard-label {
    margin-top: 12px;
    color: var(--ui-text-soft);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.deck-count-badge,
.discard-count-badge {
    width: 32px;
    height: 32px;
    right: -8px;
    bottom: -8px;
    font-size: 0.86rem;
}

/* Hand: larger cards, less surrounding furniture. */
#playtestMode > .mode-columns .hand-panel {
    padding: var(--ui-space-3) var(--ui-space-4);
    background: rgba(29, 18, 13, 0.54);
}

#playtestMode .hand-panel .cards-shelf {
    min-height: 194px;
    gap: var(--ui-space-3);
    padding: var(--ui-space-2) 2px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#playtestMode .hand-panel .card {
    width: 118px;
    height: 174px;
    flex: 0 0 118px;
}

#playtestMode .hand-panel #drawExtraBtn {
    padding: 7px 12px !important;
    font-size: 0.86rem !important;
}

/* Secondary information stays available without competing with play. */
#playtestMode > .mode-columns .secondary-panel {
    padding: 12px 14px !important;
    border-color: rgba(184, 138, 66, 0.12) !important;
    background: rgba(24, 15, 11, 0.42) !important;
}

#playtestMode > .mode-columns .secondary-panel .panel-title {
    min-height: 24px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    color: var(--ui-text-soft);
    border-bottom-color: var(--ui-rule-quiet);
    font-size: 1rem;
}

#playtestMode .log-panel {
    min-height: 185px;
    height: 220px;
    max-height: 220px;
    color: var(--ui-text-soft);
}

#playtestMode .log-messages {
    font-size: 0.86rem;
    line-height: 1.45;
    gap: 4px;
}

#playtestMode .log-entry {
    padding-left: 8px;
    color: var(--ui-text-soft);
    border-left-color: rgba(184, 138, 66, 0.2);
}

#playtestMode .opponent-mini-card {
    padding: 8px 9px;
    border: 0;
    border-left: 3px solid rgba(184, 138, 66, 0.25);
    background: rgba(9, 6, 4, 0.18);
    box-shadow: none;
}

#playtestMode .opponent-name {
    font-size: 0.9rem;
}

#playtestMode .opponent-stats {
    font-size: 0.8rem;
}

#playtestMode > .mode-columns .session-controls {
    padding: 10px !important;
    border: 0;
    background: transparent;
}

#playtestMode .session-controls .action-bar {
    gap: var(--ui-space-2);
}

#playtestMode .session-controls .btn-danger {
    margin-right: auto;
    font-size: 0.78rem;
}

/* Card readability and interaction states */
.card {
    border-radius: var(--ui-radius);
    transition: transform var(--ui-transition), box-shadow var(--ui-transition), filter var(--ui-transition), opacity var(--ui-transition);
}

.card:hover {
    transform: translateY(-5px);
}

.card .card-name {
    font-size: 0.76rem;
    line-height: 1.08;
}

.card .card-type-label,
.card .card-slot-type {
    font-size: 0.62rem !important;
    letter-spacing: 0.035em;
}

/* A price is shop information, not permanent card information. */
.card .card-cost {
    display: none;
}

.shop-sale-card > .card-art-overlay ~ .card-header {
    right: 43px !important;
    padding-right: 5px;
    z-index: 2;
}

.shop-sale-tag {
    position: absolute;
    top: auto !important;
    right: -5px !important;
    bottom: -13px;
    left: auto !important;
    z-index: 20 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 37px;
    min-height: 42px;
    padding: 6px 3px 5px;
    clip-path: polygon(12% 0, 88% 0, 100% 10%, 100% 90%, 88% 100%, 12% 100%, 0 90%, 0 10%);
    color: #342315;
    border: 1px solid #6b4c31;
    background:
        repeating-linear-gradient(0deg, rgba(87, 65, 39, 0.045) 0 1px, transparent 1px 4px),
        repeating-linear-gradient(90deg, rgba(87, 65, 39, 0.025) 0 1px, transparent 1px 5px),
        linear-gradient(145deg, #f4ecd8, #ddd0b6 58%, #c3ad89);
    box-shadow: 0 3px 6px rgba(23, 13, 7, 0.52), inset 0 0 0 1px rgba(255, 250, 234, 0.78);
    font-family: var(--period-text);
    line-height: 1;
    pointer-events: none;
    transform: rotate(var(--shop-ticket-angle, -1.5deg));
}

.shop-sale-tag::before {
    content: '';
    position: absolute;
    top: 3px;
    width: 5px;
    height: 5px;
    border: 1px solid #69492f;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #352317 0 28%, #8b704f 31% 48%, #352317 51%);
    box-shadow: 0 1px 1px rgba(255, 246, 223, 0.65);
}

.shop-sale-tag__label {
    margin-top: 4px;
    color: #513522;
    font-size: 0.27rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.shop-sale-tag__price {
    margin-top: 1px;
    color: #2b1b11;
    font-family: var(--period-display);
    font-size: 1.22rem;
    font-weight: 800;
    font-variant-numeric: lining-nums tabular-nums;
    text-shadow: 0 1px 0 rgba(255, 250, 230, 0.78);
}

.shop-sale-tag::after {
    content: 'Æ';
    margin-top: 1px;
    color: #513522;
    font-family: var(--period-display);
    font-size: 0.42rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.shop-sale-tag--discounted {
    background:
        repeating-linear-gradient(0deg, rgba(49, 78, 49, 0.05) 0 1px, transparent 1px 4px),
        linear-gradient(145deg, #edf0dc, #c9d2b1 58%, #a8b78e);
    border-color: #657b5a;
}

.shop-sale-tag--discounted .shop-sale-tag__label,
.shop-sale-tag--discounted .shop-sale-tag__price { color: #284423; }

.shop-sale-tag--marked-up {
    background:
        linear-gradient(145deg, #f0dfd0, #d6b8a3 58%, #b38a73);
    border-color: #84604e;
}

.shop-sale-tag--marked-up .shop-sale-tag__label,
.shop-sale-tag--marked-up .shop-sale-tag__price { color: #572418; }

.shop-sale-tag--free {
    width: 37px;
    background:
        repeating-linear-gradient(0deg, rgba(39, 88, 64, 0.05) 0 1px, transparent 1px 4px),
        linear-gradient(145deg, #e7eedc, #c0d1ba 58%, #98ad94);
    border-color: #5b7961;
}

.shop-sale-tag--free .shop-sale-tag__label,
.shop-sale-tag--free .shop-sale-tag__price { color: #1f4c35; }

.shop-sale-tag--free .shop-sale-tag__label {
    font-size: 0.25rem;
    letter-spacing: 0.025em;
}

.shop-sale-tag--free .shop-sale-tag__price { font-size: 0.73rem; }
.shop-sale-tag--free::after { content: 'OFFER'; font-family: var(--period-text); font-size: 0.22rem; }

.shop-sale-card { overflow: visible !important; }

#shopMarketContainer .shop-sale-card { margin-bottom: 19px; }

.card.buyable {
    filter: saturate(1.06) brightness(1.03);
}

#shopMarketContainer .card.unaffordable:not(.in-basket),
.card.salvage-card.unaffordable:not(.in-basket) {
    opacity: 0.84;
    filter: saturate(0.86) brightness(0.94);
}

#shopMarketContainer .card.unaffordable:hover,
.card.salvage-card.unaffordable:hover {
    opacity: 0.84;
    filter: saturate(0.82) brightness(0.92);
}

.card.in-basket {
    outline: 3px solid var(--ui-success);
    outline-offset: 3px;
}

/* Shopping is a focused catalog. */
#shopView {
    width: 100%;
    max-width: 1480px;
    gap: var(--ui-space-3);
}

.shop-masthead {
    margin: 0;
    padding: 10px 16px 9px;
    border: 0;
    border-bottom: 1px solid var(--ui-rule);
    background: transparent;
    text-align: left;
}

.shop-masthead h2 {
    font-size: 1.65rem;
}

.shop-masthead p {
    font-size: 0.88rem;
}

.shop-stats-bar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(184, 138, 66, 0.48);
    border-radius: var(--ui-radius);
    background: linear-gradient(90deg, rgba(226, 211, 172, 0.97), rgba(196, 176, 130, 0.97));
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.shop-stat {
    min-height: 84px;
    min-width: 0;
    padding: 12px 16px 10px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    border-right: 1px solid rgba(82, 56, 29, 0.2);
}

.shop-stat-label {
    color: #60482e;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: none;
}

.shop-stat-value,
.shop-aether-stat .shop-stat-value {
    color: #4f291f;
    font-family: var(--ui-font-display);
    font-size: clamp(1.55rem, 2.1vw, 2.05rem);
    line-height: 1;
}

.shop-stat--grants .shop-stat-value {
    color: #354e4a;
}

.shop-stat-value-group {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.shop-aether-stat .shop-stat-value {
    color: #6b531f;
}

.shop-stat-divider {
    color: #775f3c;
    font-size: 1rem;
}

.shop-aether-stat .aether-in-hand {
    margin: 2px 0 0;
    color: #695537;
    font-size: 0.68rem;
}

.shop-actions {
    align-self: stretch;
    justify-content: center;
    gap: var(--ui-space-2);
    padding: 12px;
    border-left: 1px solid rgba(82, 56, 29, 0.2);
}

#endShoppingBtn {
    min-height: 42px;
    padding: 9px 20px;
    color: #f8e8bd;
    border: 1px solid #9c5c4e;
    border-radius: var(--ui-radius);
    background: linear-gradient(#7b3932, #50241f);
    box-shadow: none;
    font-size: 0.94rem;
}

.shop-scroll {
    gap: var(--ui-space-5);
    padding: 0 4px var(--ui-space-6);
}

.shop-section,
.shop-section.glass-panel {
    padding: 0 0 var(--ui-space-5);
    border: 0;
    border-bottom: 1px solid var(--ui-rule);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.shop-section:last-child {
    border-bottom: 0;
}

.shop-section-header {
    margin-bottom: var(--ui-space-3);
    padding: 0 2px var(--ui-space-2);
    border-bottom: 0;
}

.shop-section-kicker {
    color: var(--ui-text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

.shop-section-header h3 {
    color: var(--ui-text);
    font-size: 1.42rem;
    letter-spacing: 0.02em;
}

#shopDeckCountText {
    color: var(--ui-text-soft) !important;
    font-size: 0.8rem !important;
}

.shop-section .cards-shelf {
    min-height: 220px;
    gap: var(--ui-space-4);
    padding: 8px 4px 12px;
    align-items: flex-start;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#shopMarketContainer {
    flex-wrap: wrap;
    overflow-x: visible;
}

#shopMarketContainer .card,
#shopMarketContainer .essence-well-card,
#shopHandContainer .card {
    width: 138px;
    min-width: 138px;
}

#shopMarketContainer .card,
#shopHandContainer .card {
    height: 204px;
}

.shop-hand-section {
    opacity: 0.78;
}

.shop-hand-section::before {
    content: 'Your current hand';
    display: block;
    color: var(--ui-text-muted);
    font-family: var(--ui-font-display);
    font-size: 1.05rem;
}

.shop-basket-panel {
    margin: 0;
    padding: 12px 16px;
    border: 1px solid rgba(184, 138, 66, 0.54);
    border-radius: var(--ui-radius);
}

.shop-basket-title {
    font-size: 1.2rem;
}

.shop-basket-chip {
    padding: 5px 9px;
    font-size: 0.78rem;
}

.shop-basket-totals {
    font-size: 0.92rem;
}

/* Upgrade tiles share the catalog system and communicate state in words. */
#shopTrainersContainer {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: var(--ui-space-3);
}

#shopTrainersContainer .trainer-icon-card {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    grid-template-rows: 1fr auto;
    column-gap: var(--ui-space-3);
    row-gap: var(--ui-space-2);
    align-items: center;
    min-height: 132px;
    padding: 14px;
    color: var(--ui-text);
    border: 1px solid var(--ui-rule);
    border-left: 4px solid rgba(184, 138, 66, 0.42);
    border-radius: var(--ui-radius);
    background: rgba(31, 21, 15, 0.72);
    box-shadow: none;
    text-align: left;
}

#shopTrainersContainer .trainer-icon-card:hover {
    border-color: rgba(217, 186, 115, 0.7);
    background: rgba(48, 31, 21, 0.88);
    transform: translateY(-2px);
}

#shopTrainersContainer .trainer-tile-media {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    min-height: 82px;
    border-right: 1px solid var(--ui-rule-quiet);
}

#shopTrainersContainer .trainer-icon-img {
    width: 58px;
    height: 58px;
}

#shopTrainersContainer .trainer-tile-copy {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

#shopTrainersContainer .trainer-tile-name {
    color: #ead7aa;
    font-family: var(--ui-font-display);
    font-size: 1.08rem;
    line-height: 1.05;
}

#shopTrainersContainer .trainer-tile-effect {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ui-text-soft);
    font-size: 0.78rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

#shopTrainersContainer .trainer-icon-cost {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    min-width: 58px;
    margin: 0;
    padding: 6px 7px;
    color: #3f2c1c;
    border-radius: var(--ui-radius);
    background: var(--ui-paper);
    text-align: center;
}

#shopTrainersContainer .trainer-icon-cost strong {
    display: block;
    color: #5f3f18;
    font-family: var(--ui-font-display);
    font-size: 1.45rem;
    line-height: 0.85;
}

#shopTrainersContainer .trainer-icon-cost span {
    display: block;
    margin-top: 4px;
    font-size: 0.62rem;
    font-weight: 700;
}

#shopTrainersContainer .trainer-state-label {
    grid-column: 2 / 4;
    grid-row: 2;
    color: var(--ui-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.035em;
}

#shopTrainersContainer .trainer-icon-card.available .trainer-state-label::before,
#shopTrainersContainer .trainer-icon-card.in-basket .trainer-state-label::before,
#shopTrainersContainer .trainer-icon-card.owned .trainer-state-label::before,
#shopTrainersContainer .trainer-icon-card.locked .trainer-state-label::before,
#shopTrainersContainer .trainer-icon-card.unaffordable .trainer-state-label::before {
    margin-right: 5px;
}

#shopTrainersContainer .trainer-icon-card.available {
    border-left-color: var(--ui-success);
}
#shopTrainersContainer .trainer-icon-card.available .trainer-state-label { color: #a9c6a4; }
#shopTrainersContainer .trainer-icon-card.available .trainer-state-label::before { content: '◆'; }

#shopTrainersContainer .trainer-icon-card.in-basket {
    border-left-color: var(--ui-brass-light);
    outline: 2px solid rgba(217, 186, 115, 0.54);
    outline-offset: 1px;
}
#shopTrainersContainer .trainer-icon-card.in-basket .trainer-state-label { color: var(--ui-brass-light); }
#shopTrainersContainer .trainer-icon-card.in-basket .trainer-state-label::before { content: '✓'; }

#shopTrainersContainer .trainer-icon-card.owned {
    border-left-color: var(--ui-success);
    background: rgba(37, 61, 43, 0.5);
    opacity: 0.8;
}
#shopTrainersContainer .trainer-icon-card.owned .trainer-state-label::before { content: '✓'; }

#shopTrainersContainer .trainer-icon-card.locked,
#shopTrainersContainer .trainer-icon-card.unaffordable {
    cursor: not-allowed;
    opacity: 0.68;
    filter: grayscale(0.35);
}
#shopTrainersContainer .trainer-icon-card.locked .trainer-state-label,
#shopTrainersContainer .trainer-icon-card.unaffordable .trainer-state-label { color: #c19a91; }
#shopTrainersContainer .trainer-icon-card.locked .trainer-state-label::before { content: '◆'; }
#shopTrainersContainer .trainer-icon-card.unaffordable .trainer-state-label::before { content: '—'; }

/* Popups remain supplemental, but are comfortably readable. */
.period-tooltip,
#floatingTooltip,
.tutorial-tooltip {
    max-width: 330px;
    padding: 13px 16px;
    font-size: 0.92rem;
    line-height: 1.5;
}

@media (max-width: 1180px) {
    #playtestMode > .mode-columns {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: var(--ui-space-3);
    }

    #shopTrainersContainer {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }

    .shop-stat {
        padding-inline: 10px;
    }
}

@media (max-width: 980px) {
    #playtestMode > .mode-columns {
        grid-template-columns: 1fr;
    }

    #playtestMode > .mode-columns .column-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    #strategyTipContainer,
    .session-controls {
        grid-column: 1 / -1;
    }

    .shop-stats-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
    }

    .shop-actions {
        grid-column: 1 / -1;
        width: 100%;
        margin: 0;
        border-top: 1px solid rgba(82, 56, 29, 0.2);
        border-left: 0;
    }
}

@media (max-width: 720px) {
    .app-tools {
        width: 100%;
        flex-wrap: wrap;
    }

    #playtestMode .stats-hud {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #playtestMode .stat-card {
        min-height: 64px;
        border-bottom: 1px solid rgba(82, 56, 29, 0.18);
    }

    #playtestMode .stat-card--phase {
        grid-column: 1 / -1;
    }

    #playtestMode > .mode-columns .column-side {
        display: flex;
    }

    #shopTrainersContainer {
        grid-template-columns: 1fr;
    }

    .shop-stat {
        flex: 1 1 33%;
        border-right: 0;
        border-bottom: 1px solid rgba(82, 56, 29, 0.18);
    }

    .shop-actions .btn {
        flex: 1 1 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Shared printed-card template: name, value, artwork, then type. */
.card:not(.card-zoom-card) > div.card-art-overlay {
    background: linear-gradient(180deg, rgba(27, 17, 10, 0.025) 0%, rgba(27, 17, 10, 0) 62%, rgba(27, 17, 10, 0.09) 100%);
}

.card:not(.card-zoom-card) > .card-art-overlay ~ .card-header {
    top: 3px !important;
    right: 46px !important;
    left: 3px !important;
    z-index: 4;
    display: block;
    min-height: 20px;
    max-height: 30px;
    padding: 4px 7px 4px 8px;
    overflow: hidden;
    border: 1px solid rgba(108, 83, 52, 0.76);
    clip-path: polygon(3% 0, 97% 0, 100% 10%, 100% 90%, 97% 100%, 3% 100%, 0 90%, 0 10%);
    background:
        repeating-linear-gradient(0deg, rgba(78, 60, 39, 0.055) 0 1px, transparent 1px 4px),
        linear-gradient(145deg, rgba(247, 239, 218, 0.96), rgba(213, 198, 165, 0.96));
    box-shadow: inset 0 0 0 1px rgba(255, 252, 239, 0.58), 0 1px 2px rgba(23, 13, 7, 0.34);
}

.card:not(.card-zoom-card) > .card-art-overlay ~ .card-header .card-name {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    color: #332417;
    font-family: var(--period-display);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 rgba(255, 252, 239, 0.7);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card:not(.card-zoom-card) > .card-art-overlay ~ .card-header .card-type-label,
.card:not(.card-zoom-card) .card-subtype-badge {
    display: none;
}

.card:not(.card-zoom-card) > .card-art-overlay ~ .card-value,
.card:not(.card-zoom-card).archetype-aether .card-value {
    top: 4px !important;
    right: 4px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 5;
    width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 0 1px !important;
    transform: none !important;
    border: 2px solid #746047;
    border-radius: 50%;
    background:
        repeating-radial-gradient(circle at 50% 50%, rgba(36, 29, 19, 0.055) 0 1px, transparent 1px 4px),
        linear-gradient(145deg, #9e8d6b, #6d5d44 58%, #4d402f);
    box-shadow: inset 0 0 0 1px rgba(222, 205, 164, 0.36), 0 1px 2px rgba(21, 11, 5, 0.48);
    color: #251c13;
    font-family: var(--period-display);
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(232, 219, 183, 0.45);
}

.card:not(.card-zoom-card) > .card-art-overlay ~ .card-value::after,
.card:not(.card-zoom-card).archetype-aether .card-value::after {
    content: none !important;
}

.card:not(.card-zoom-card) .card-value-change,
.card:not(.card-zoom-card) .card-value-popup {
    display: none !important;
}

.card:not(.card-zoom-card) > .card-art-overlay ~ .card-slot-type,
.card:not(.card-zoom-card) > .card-slot-type {
    right: 6px;
    bottom: 6px;
    left: 6px;
    z-index: 4;
    min-width: 0;
    max-width: none;
    padding: 0;
    transform: none;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #3d2a1b;
    font-family: var(--period-text);
    font-size: 0.39rem !important;
    font-weight: 800;
    letter-spacing: 0.22em;
    line-height: 1.05;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 248, 228, 0.7);
    text-transform: uppercase;
}

.card:not(.card-zoom-card) > .card-art-overlay ~ .card-slot-type:not(:empty)::before,
.card:not(.card-zoom-card) > .card-art-overlay ~ .card-slot-type:not(:empty)::after {
    content: '—';
    display: inline-block;
    margin: 0 0.55em;
    color: rgba(79, 56, 36, 0.74);
    letter-spacing: 0;
}

/* The shopkeeper's ticket is the only purchase-price information on a card. */
.shop-sale-tag {
    right: -5px !important;
    bottom: -13px;
    z-index: 22 !important;
}

/* The ticket is physically attached to the shop card's lower-right frame. */
#shopMarketContainer .card.shop-sale-card > .shop-sale-tag {
    position: absolute !important;
    top: auto !important;
    right: -5px !important;
    bottom: -13px !important;
    left: auto !important;
    z-index: 30 !important;
}

/* Keep the same information architecture at inspection size. */
.card-zoom-card > .card-art-overlay {
    background: linear-gradient(180deg, rgba(27, 17, 10, 0.025) 0%, rgba(27, 17, 10, 0) 62%, rgba(27, 17, 10, 0.09) 100%);
}

.card-zoom-card > .card-art-overlay ~ .card-header {
    top: 18px !important;
    right: 112px !important;
    left: 18px !important;
    min-height: 47px;
    max-height: 74px;
    padding: 10px 13px;
    border: 2px solid rgba(108, 83, 52, 0.76);
    border-radius: 1px;
    background:
        repeating-linear-gradient(0deg, rgba(78, 60, 39, 0.055) 0 1px, transparent 1px 5px),
        linear-gradient(145deg, rgba(247, 239, 218, 0.96), rgba(213, 198, 165, 0.96));
    box-shadow: inset 0 0 0 2px rgba(255, 252, 239, 0.58), 0 2px 4px rgba(23, 13, 7, 0.34);
}

.card-zoom-card > .card-art-overlay ~ .card-header .card-name {
    font-size: 1.32rem;
    color: #332417;
}

.card-zoom-card > .card-art-overlay ~ .card-value,
.card-zoom-card.archetype-aether .card-value {
    top: 19px !important;
    right: 20px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 5;
    width: 72px !important;
    height: 72px !important;
    padding: 0 0 2px !important;
    transform: none !important;
    border: 5px solid #746047;
    border-radius: 50%;
    background:
        repeating-radial-gradient(circle at 50% 50%, rgba(36, 29, 19, 0.055) 0 1px, transparent 1px 7px),
        linear-gradient(145deg, #9e8d6b, #6d5d44 58%, #4d402f);
    box-shadow: inset 0 0 0 2px rgba(222, 205, 164, 0.36), 0 3px 5px rgba(21, 11, 5, 0.48);
    color: #251c13;
    font-family: var(--period-display);
    font-size: 2.6rem;
    line-height: 1;
    text-shadow: 0 2px 0 rgba(232, 219, 183, 0.45);
}

.card-zoom-card > .card-art-overlay ~ .card-value::after,
.card-zoom-card.archetype-aether .card-value::after { content: none !important; }

.card-zoom-card > .card-art-overlay ~ .card-slot-type {
    right: 18px;
    bottom: 18px;
    left: 18px;
    min-width: 0;
    max-width: none;
    padding: 0;
    transform: none;
    border: 0;
    border-radius: 0;
    background: none;
    color: #3d2a1b;
    font-family: var(--period-text);
    font-size: 0.72rem !important;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.card-zoom-card > .card-art-overlay ~ .card-slot-type:not(:empty)::before,
.card-zoom-card > .card-art-overlay ~ .card-slot-type:not(:empty)::after {
    content: '—';
    display: inline-block;
    margin: 0 0.55em;
    color: rgba(79, 56, 36, 0.74);
    letter-spacing: 0;
}

/* Final material/readability polish for the Academy dealer's counter. */
.card:not(.card-zoom-card) > .card-art-overlay ~ .card-header {
    min-height: 0;
    max-height: none;
    padding-top: 4px;
    padding-bottom: 4px;
    border-color: rgba(93, 68, 42, 0.88);
    box-shadow: inset 0 0 0 1px rgba(255, 252, 239, 0.7), 0 2px 2px rgba(23, 13, 7, 0.38);
}

.card:not(.card-zoom-card) > .card-art-overlay ~ .card-header .card-name {
    color: #251a10;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.018em;
    line-height: 1.04;
    text-shadow: 0 1px 0 rgba(255, 253, 242, 0.82);
}

.card:not(.card-zoom-card) > .card-art-overlay ~ .card-value,
.card:not(.card-zoom-card).archetype-aether .card-value {
    width: 33px !important;
    height: 33px !important;
    min-height: 33px !important;
    border-color: #66543e;
    background:
        repeating-radial-gradient(circle at 50% 50%, rgba(28, 22, 14, 0.065) 0 1px, transparent 1px 4px),
        linear-gradient(145deg, #a49372, #6c5b42 58%, #443728);
    box-shadow: inset 0 0 0 1px rgba(232, 217, 176, 0.44), 0 1px 2px rgba(21, 11, 5, 0.52);
    color: #1d160f;
    font-size: 1.43rem;
    text-shadow: 0 1px 0 rgba(242, 232, 199, 0.55);
}

.card:not(.card-zoom-card) > .card-art-overlay ~ .card-slot-type,
.card:not(.card-zoom-card) > .card-slot-type {
    right: 5px;
    bottom: 5px;
    left: 5px;
    padding: 3px 0 2px;
    border-top: 1px solid rgba(70, 47, 28, 0.5);
    border-bottom: 1px solid rgba(70, 47, 28, 0.38);
    background: linear-gradient(90deg, transparent, rgba(248, 239, 215, 0.78) 17%, rgba(248, 239, 215, 0.78) 83%, transparent);
    color: #26180e;
    font-size: 0.54rem !important;
    font-weight: 800;
    letter-spacing: 0.18em;
    line-height: 1.1;
    text-shadow: 0 1px 0 rgba(255, 251, 236, 0.9);
}

.card:not(.card-zoom-card) > .card-slot-type:empty {
    display: none;
}

.card.archetype-skill > .card-slot-type:empty {
    display: block;
}

.card.archetype-skill > .card-slot-type:empty::after {
    content: '— SKILL —';
}

/* Mandatory-play notices sit below the archival title label, never beneath it. */
.card:not(.card-zoom-card) .card-mustplay-label {
    position: absolute;
    top: auto;
    right: 15px;
    bottom: 29px;
    left: 15px;
    z-index: 5;
    margin: 0;
    padding: 2px 0;
    font-size: 0.52rem;
    letter-spacing: 0.1em;
    line-height: 1;
}

/* A small price ticket, attached beyond the lower-right card edge. */
.shop-sale-tag,
#shopMarketContainer .card.shop-sale-card > .shop-sale-tag {
    right: -10px !important;
    bottom: -11px !important;
}

/* A restrained mahogany dealer's tray gives the specimens a physical setting. */
#shopMarketContainer {
    position: relative;
    isolation: isolate;
    gap: 20px;
    padding: 15px 18px 25px !important;
    border: 1px solid rgba(142, 104, 57, 0.62);
    border-radius: 3px;
    background:
        repeating-linear-gradient(92deg, rgba(255, 224, 166, 0.026) 0 1px, transparent 1px 11px),
        linear-gradient(180deg, rgba(15, 8, 5, 0.18), transparent 22%),
        linear-gradient(135deg, #2d180f, #1d0f0a 62%, #29150d);
    box-shadow: inset 0 0 0 2px rgba(11, 6, 4, 0.36), inset 0 0 18px rgba(0, 0, 0, 0.32), 0 1px 2px rgba(0, 0, 0, 0.3);
}

#shopMarketContainer .card.shop-sale-card,
.card.salvage-card.shop-sale-card {
    transform: translateY(var(--shop-card-rest-y, 0px)) rotate(var(--shop-card-tilt, 0deg));
    transform-origin: 50% 62%;
    box-shadow: inset 0 0 0 1px rgba(255, 248, 226, 0.22), 0 2px 2px rgba(13, 7, 4, 0.46), 0 5px 7px rgba(13, 7, 4, 0.2) !important;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, opacity 180ms ease;
}

#shopMarketContainer .card.shop-sale-card:hover,
.card.salvage-card.shop-sale-card:hover {
    transform: translateY(calc(var(--shop-card-rest-y, 0px) - 5px)) rotate(0deg);
    box-shadow: inset 0 0 0 1px rgba(255, 248, 226, 0.38), 0 3px 3px rgba(13, 7, 4, 0.56), 0 10px 13px rgba(13, 7, 4, 0.3) !important;
}

#shopMarketContainer .card.shop-sale-card.in-basket,
.card.salvage-card.shop-sale-card.in-basket {
    transform: translateY(calc(var(--shop-card-rest-y, 0px) - 3px)) rotate(0deg);
    border-color: #927448;
    box-shadow: inset 0 0 0 1px rgba(246, 232, 191, 0.48), 0 3px 3px rgba(13, 7, 4, 0.54), 0 8px 11px rgba(13, 7, 4, 0.26) !important;
}

/* Clerk-applied inventory mark: readable but intentionally imperfect. */
#shopMarketContainer .essence-well-card {
    position: relative;
    padding-bottom: 2px;
}

#shopMarketContainer .card-ownership-badge {
    margin: 7px auto 0;
    padding: 3px 5px 2px;
    border: 1px double rgba(92, 36, 35, 0.78);
    border-radius: 0;
    background: rgba(236, 218, 186, 0.08);
    box-shadow: none;
    color: #632f30;
    font-family: var(--period-text);
    font-size: 0.43rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    line-height: 1.05;
    opacity: 0.9;
    text-shadow: 0.35px 0 rgba(97, 42, 42, 0.26), -0.2px 0 rgba(68, 26, 25, 0.18);
    transform: rotate(-1.2deg);
}

/* Returning players normally begin without guidance. */
.welcome-actions .welcome-new-game-btn {
    order: -1;
    min-height: 48px;
    padding: 12px 22px;
    color: #fff1c9;
    border-color: #6f422d;
    background: linear-gradient(#774331, #49251b);
    box-shadow: 0 3px 7px rgba(31, 15, 9, 0.34);
    font-size: 1.08rem;
    font-weight: 800;
}

.welcome-actions .welcome-new-game-btn:hover {
    border-color: #a27a43;
    background: linear-gradient(#87503a, #552d20);
}

.online-room-box { max-width: 500px; }
.online-room-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; margin: 18px 0 12px; }
.online-room-form label { display: grid; gap: 4px; color: #60472c; font: 700 .72rem var(--period-text); letter-spacing: .06em; text-transform: uppercase; }
.online-room-form .online-room-endpoint { grid-column: 1 / -1; }
.online-room-form .online-room-game-name { grid-column: 1 / -1; }
.online-room-join-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 3px; color: #776141; font: 700 .68rem var(--period-text); letter-spacing: .1em; }
.online-room-join-divider::before, .online-room-join-divider::after { content: ''; flex: 1; height: 1px; background: rgba(105,72,37,.35); }
.online-room-join-form { grid-template-columns: 1fr; margin-top: 9px; }
.stat-card--room .stat-value { font-size: 1.05rem; letter-spacing: .11em; }
.online-room-form input, .online-room-form select { min-width: 0; padding: 9px 10px; border: 1px solid rgba(105,72,37,.55); background: #f5ead0; color: #3d281a; font: .9rem var(--period-text); }
.online-room-error { min-height: 1.1em; margin: 4px 0 10px; color: #8b2720; font: .78rem var(--period-text); }
.online-room-lobby { margin-top: 17px; border-top: 1px solid rgba(105,72,37,.35); padding-top: 13px; color: #60472c; font: .82rem var(--period-text); }
.online-room-lobby--host { margin-top: 13px; }
.online-room-ready { margin-top: 8px; }
.online-room-ready:disabled { cursor: default; opacity: .7; }
.online-room-is-waiting .online-room-form,
.online-room-is-waiting .setup-btn-row,
.online-room-is-waiting .online-room-join-divider,
.online-room-is-waiting .online-room-error { display: none; }
.online-room-is-waiting .online-room-lobby--host { margin-top: 22px; }

/* Saved online exhibitions sit apart from the main welcome actions. */
.welcome-main-actions { justify-content: center; }
.online-save-list { display: grid; gap: 7px; margin-top: 19px; padding-top: 13px; border-top: 3px double rgba(105, 76, 38, 0.5); text-align: left; }
.online-save-list-title { color: #705637; font: 700 .67rem var(--period-text); letter-spacing: .13em; text-align: center; text-transform: uppercase; }
.online-save-entry { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 8px 9px 8px 12px; border: 1px solid rgba(105, 72, 37, .38); background: rgba(255, 249, 225, .46); }
.online-save-entry-copy { display: grid; min-width: 0; gap: 2px; }
.online-save-entry-name { overflow: hidden; color: #44291c; font: 700 .95rem var(--period-display); letter-spacing: .03em; text-overflow: ellipsis; white-space: nowrap; }
.online-save-entry-players { overflow: hidden; color: #715d42; font: .68rem var(--period-text); letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.online-save-entry-resume { flex: 0 0 auto; min-height: 30px !important; padding: 5px 12px !important; font-size: .73rem !important; }
.online-save-entry-actions { display: flex; align-items: center; gap: 7px; }
.online-save-entry-delete { width: 24px; height: 24px; padding: 0; color: #8b2720; border: 1px solid rgba(126, 39, 31, .48); background: rgba(255, 245, 222, .6); cursor: pointer; font: 700 1.2rem/1 var(--period-text); }
.online-save-entry-delete:hover { color: #fff4d8; border-color: #721f1b; background: #8b2720; }
#onlineRoomCode { display: grid; justify-items: center; gap: 5px; margin: 12px 0; color: #4b291d; }
#onlineRoomCode:empty { display: none; }
.online-room-code-label { color: #6b5235; font: 700 .66rem var(--period-text); letter-spacing: .1em; text-transform: uppercase; }
#onlineRoomCode strong { font: 800 1.55rem var(--period-display); letter-spacing: .16em; }
.online-room-copy, .results-online-room-code button { border: 1px solid rgba(105,72,37,.55); background: #f5ead0; color: #4b291d; cursor: pointer; font: 700 .67rem var(--period-text); letter-spacing: .07em; padding: 4px 8px; text-transform: uppercase; }
.online-room-copy:hover, .results-online-room-code button:hover { background: #ead9af; }
.results-online-room-code { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 11px; padding-top: 9px; border-top: 1px solid rgba(105,72,37,.32); color: #6b5235; font: 700 .64rem var(--period-text); letter-spacing: .08em; text-transform: uppercase; }
.results-online-room-code strong { color: #3f271a; font: 800 .94rem var(--period-display); letter-spacing: .15em; }
#onlineRoomRoster { display: grid; gap: 5px; margin: 8px 0; }
.online-room-member { display: flex; justify-content: space-between; padding: 6px 9px; border: 1px solid rgba(105,72,37,.24); background: rgba(255,249,225,.5); }
#onlineRoomConnection { min-height: 1em; color: #776141; font-size: .72rem; }

/* Permanent classification dial: ivory enamel and a thin, tarnished brass fitting. */
.card:not(.card-zoom-card) > .card-art-overlay ~ .card-value,
.card:not(.card-zoom-card).archetype-aether .card-value {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 0 1px !important;
    border: 1.5px solid #756248;
    border-radius: 50%;
    background:
        radial-gradient(circle at 37% 31%, rgba(255, 253, 242, 0.86) 0 11%, transparent 12%),
        radial-gradient(circle at 50% 52%, #f7efd9 0 62%, #e4d7bc 100%);
    box-shadow: inset 0 0 0 1px rgba(116, 96, 67, 0.18), inset 0 1px 1px rgba(255, 254, 245, 0.82), 0 1px 2px rgba(21, 11, 5, 0.48);
    color: #21150d;
    font-family: var(--period-display);
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 0.88;
    text-shadow: 0 1px 0 rgba(255, 253, 242, 0.76);
}

.card-zoom-card > .card-art-overlay ~ .card-value,
.card-zoom-card.archetype-aether .card-value {
    border: 3px solid #756248;
    background:
        radial-gradient(circle at 37% 31%, rgba(255, 253, 242, 0.86) 0 11%, transparent 12%),
        radial-gradient(circle at 50% 52%, #f7efd9 0 62%, #e4d7bc 100%);
    box-shadow: inset 0 0 0 2px rgba(116, 96, 67, 0.18), inset 0 2px 2px rgba(255, 254, 245, 0.82), 0 3px 5px rgba(21, 11, 5, 0.48);
    color: #21150d;
    font-size: 3.45rem;
    line-height: 0.88;
    text-shadow: 0 2px 0 rgba(255, 253, 242, 0.76);
}

/* Shop interaction should feel like handling a physical card, not activating a widget. */
#shopMarketContainer .card.buyable,
#shopMarketContainer .card.in-basket,
.card.salvage-card.buyable,
.card.salvage-card.in-basket {
    outline: 0;
    animation: none;
    border-color: #8a714c;
    box-shadow: inset 0 0 0 1px rgba(255, 248, 226, 0.3), 0 4px 8px rgba(29, 18, 10, 0.34);
}

#shopMarketContainer .card.buyable::after,
#shopMarketContainer .card.in-basket::after,
.card.salvage-card.buyable::after,
.card.salvage-card.in-basket::after {
    display: none;
}

#shopMarketContainer .card.shop-sale-card:hover,
.card.salvage-card.shop-sale-card:hover {
    transform: translateY(-6px);
    filter: saturate(1.035) brightness(1.035);
    box-shadow: inset 0 0 0 1px rgba(255, 248, 226, 0.42), 0 9px 15px rgba(29, 18, 10, 0.45);
}

#shopMarketContainer .card.shop-sale-card:hover > .card-value,
.card.salvage-card.shop-sale-card:hover > .card-value {
    border-color: #a98a56;
    box-shadow: inset 0 0 0 1px rgba(233, 216, 175, 0.46), 0 2px 4px rgba(21, 11, 5, 0.56);
}

#shopMarketContainer .card.unaffordable:hover,
.card.salvage-card.unaffordable:hover {
    opacity: 0.92;
    filter: saturate(0.92) brightness(0.98);
}
