/* Cardswild solo tables. Same felt, gold and type as /play, plain HTML cards. */
:root {
    --felt: #1a3a1a;
    --felt-deep: #0a1a0a;
    --gold: #c9a84c;
    --gold-soft: rgba(201, 168, 76, 0.45);
    --cream: #faf3e0;
    --muted: rgba(250, 243, 224, 0.68);
    --red: #e07a6a;
    --w-lg: clamp(68px, 9.2vw, 124px);
    --w-md: clamp(54px, 7.4vw, 100px);
    --w-sm: clamp(42px, 5.4vw, 76px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--felt-deep); }
body {
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% 30%, #24502a 0%, var(--felt) 45%, var(--felt-deep) 100%) fixed;
    color: var(--cream);
    font-family: 'Lora', Georgia, serif;
    font-size: 15px;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--gold); }
.noscript { padding: 40px; text-align: center; }

.solo-app { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 12px 0 10px;
    border-bottom: 1px solid var(--gold-soft);
}
.topbar .back { font-family: 'Cinzel', serif; font-size: 13px; text-decoration: none; color: var(--muted); }
.topbar .back::before { content: '\2039\00a0'; }
.topbar .back:hover { color: var(--gold); }
.topbar .title {
    font-family: 'Cinzel', serif; font-weight: 900; color: var(--gold);
    font-size: clamp(20px, 3vw, 28px); letter-spacing: 2px; text-transform: uppercase;
    flex: 1; min-width: 160px;
}
.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.controls .deal { font-size: 13px; color: var(--muted); }
select.level {
    font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700;
    background: rgba(10, 26, 10, 0.8); color: var(--cream);
    border: 1.5px solid var(--gold); border-radius: 4px; padding: 6px 8px;
}

.btn {
    display: inline-block;
    font-family: 'Cinzel', serif; font-weight: 700; font-size: 14px; letter-spacing: 0.5px;
    background: var(--gold); color: #1a2410;
    border: 1.5px solid var(--gold); border-radius: 4px;
    padding: 8px 16px; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--cream); border-color: var(--cream); }
.btn.ghost { background: transparent; color: var(--cream); }
.btn.ghost:hover { background: rgba(250, 243, 224, 0.12); color: var(--cream); }
.btn.small { font-size: 12px; padding: 6px 11px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; background: transparent; color: var(--muted); border-color: var(--gold-soft); }

.msg {
    position: sticky; top: 0; z-index: 5;
    margin: 10px 0 6px; padding: 9px 14px;
    background: rgba(10, 26, 10, 0.88);
    border: 1px solid var(--gold-soft); border-radius: 4px;
    min-height: 40px;
}
.msg.warn { border-color: var(--red); color: #ffd9cf; }

/* ---------------------------------------------------------------- zones */
.zone { margin: 12px 0; }
.zone-label {
    font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700; letter-spacing: 1px;
    color: var(--gold); margin-bottom: 7px;
}
/* Details after the title, in Lora: Cinzel's figures make 11 read as II */
.zone-label .zl { font-family: 'Lora', serif; font-weight: 400; letter-spacing: 0; color: var(--cream); font-size: 14px; }
.zone-row { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.side-cards, .stacks, .piles, .hand { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.piles { gap: 18px; }
.labelled { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.labelled .under { font-family: 'Cinzel', serif; font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; min-height: 38px; }
.hint { color: var(--muted); font-style: italic; font-size: 14px; }

/* ---------------------------------------------------------------- cards */
.card {
    position: relative; flex: none;
    width: var(--w-md); aspect-ratio: 300 / 420;
    border-radius: 7px;
    background: #0d1f0d;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card img { display: block; width: 100%; height: 100%; border-radius: 7px; object-fit: cover; }
.card.sm { width: var(--w-sm); border-radius: 5px; }
.card.sm img { border-radius: 5px; }
.card.lg { width: var(--w-lg); }
.card.clickable { cursor: pointer; }
.card.target { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(201, 168, 76, 0.75); animation: glow 1.6s ease-in-out infinite; }
.card.target-soft { box-shadow: 0 0 0 2px var(--gold-soft), 0 3px 10px rgba(0, 0, 0, 0.45); }
.card.clickable:hover { transform: translateY(-3px); }
.card.selected { transform: translateY(-12px); box-shadow: 0 0 0 3px var(--cream), 0 10px 22px rgba(0, 0, 0, 0.55); }
.card.dim { opacity: 0.8; }
.card.full { box-shadow: 0 0 0 2px #6fae6f, 0 3px 10px rgba(0, 0, 0, 0.45); }
.card:focus-visible { outline: 3px solid var(--cream); outline-offset: 2px; }
@keyframes glow {
    0%, 100% { box-shadow: 0 0 0 3px var(--gold), 0 0 10px rgba(201, 168, 76, 0.45); }
    50% { box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(201, 168, 76, 0.9); }
}
.badge {
    position: absolute; right: -6px; bottom: -6px;
    min-width: 26px; padding: 2px 6px;
    background: var(--felt-deep); color: var(--cream);
    border: 1.5px solid var(--gold); border-radius: 12px;
    font-family: 'Lora', serif; font-weight: 700; font-size: 12px; text-align: center;
}
.tag {
    position: absolute; left: 50%; top: -9px; transform: translateX(-50%);
    white-space: nowrap;
    background: var(--felt-deep); color: var(--gold);
    border: 1px solid var(--gold-soft); border-radius: 10px;
    padding: 0 7px; font-size: 11px; font-family: 'Cinzel', serif;
}
.card.slot {
    display: flex; align-items: center; justify-content: center; text-align: center;
    background: rgba(0, 0, 0, 0.14);
    border: 1.5px dashed var(--gold-soft);
    box-shadow: none;
}
.slot-label { font-family: 'Lora', serif; font-size: 11px; color: var(--muted); padding: 4px; line-height: 1.25; }
.card.sm .slot-label { font-size: 10px; }

/* ---------------------------------------------------------------- dialogs */
.overlay {
    position: fixed; inset: 0; z-index: 20;
    background: rgba(5, 12, 5, 0.72);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dialog {
    max-width: 520px; width: 100%;
    background: linear-gradient(160deg, #234423, #12291a);
    border: 2px solid var(--gold); border-radius: 10px;
    padding: 22px 24px; text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.dialog h2 { font-family: 'Cinzel', serif; color: var(--gold); font-size: 24px; margin-bottom: 12px; }
.dialog p { margin-bottom: 10px; }
.dialog.lost h2 { color: #e8c9a0; }
.dialog-cards { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 6px 0 14px; }
.dialog-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ---------------------------------------------------------------- The Rival */
.rival-zone, .you-zone { background: rgba(0, 0, 0, 0.12); border-radius: 8px; padding: 10px 12px; }
.mid-zone { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-start; }
.log { list-style: none; flex: 1; min-width: 240px; font-size: 14px; color: var(--muted); }
.log li { padding: 3px 0; border-bottom: 1px solid rgba(201, 168, 76, 0.14); }
.log li:first-child { color: var(--cream); }
.hand { gap: 10px; padding-top: 14px; }
.trouble-on { box-shadow: 0 0 0 2px var(--red); }

/* ---------------------------------------------------------------- Last Light */
.calendar { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-day {
    width: 62px; height: 46px; border-radius: 5px;
    border: 1.5px dashed var(--gold-soft);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-family: 'Cinzel', serif;
}
.cal-n { font-family: 'Lora', serif; font-size: 11px; color: var(--muted); }
.cal-t { font-size: 11px; font-weight: 700; line-height: 1.1; text-align: center; }
.cal-day.today { border: 2px solid var(--gold); background: rgba(201, 168, 76, 0.12); }
.cal-day.home { border-style: solid; border-color: #6fae6f; background: rgba(111, 174, 111, 0.14); }
.cal-day.home .cal-t { color: #bfe3bf; }
.cal-day.bust { border-style: solid; border-color: var(--red); background: rgba(224, 122, 106, 0.12); }
.cal-day.bust .cal-t { color: #ffcfc4; }
.watch { margin-top: 8px; font-size: 14px; color: var(--muted); }
.trail-row { display: flex; gap: 18px; align-items: flex-start; }
.trail { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; padding-top: 10px; }
.camp-zone { background: rgba(0, 0, 0, 0.12); border-radius: 8px; padding: 10px 12px; }

/* ---------------------------------------------------------------- Hunting Party */
.hunters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.hunter { background: rgba(0, 0, 0, 0.14); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hunter-head { font-family: 'Lora', serif; font-weight: 700; color: var(--gold); letter-spacing: 0.5px; }
.hunter-next { font-size: 13px; color: var(--muted); text-align: center; min-height: 36px; }
.hunter-next.red { color: var(--red); }
.hunter-next.gold { color: var(--gold); }
.hunter-stack { position: relative; }
.card.crossed { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(90deg) scale(0.9); }
.pips { display: flex; gap: 2px; justify-content: center; }
.pip { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--gold-soft); }
.pip.gear { border-radius: 2px; }
.pip.on { background: var(--gold); border-color: var(--gold); }
.camps { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; }
.camp { display: flex; justify-content: center; }
.fan { display: flex; flex-direction: column; align-items: center; }
.fan .card:not(:last-child) { margin-bottom: calc(var(--w-sm) * -1.4 + 24px); }
.draw-zone .piles { align-items: flex-end; }

/* ---------------------------------------------------------------- Game Trail */
.grounds {
    display: grid; grid-template-columns: repeat(var(--ncols), minmax(0, 1fr));
    gap: clamp(4px, 1vw, 10px);
    max-width: calc(var(--ncols) * 108px); margin: 0 auto;
}
.gcol { display: flex; flex-direction: column; }
.card.gt { width: 100%; }
/* A face-down card shows a strip; percentage margins follow the column width */
.card.gt.down { margin-bottom: -112%; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); }
.trail-zone .trail { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
.trail-zone .trail .card:not(:last-child) { margin-right: calc(var(--w-md) * -0.45); }
.t-lastlight .trail-zone .trail { flex-wrap: wrap; overflow: visible; }
.t-lastlight .trail-zone .trail .card:not(:last-child) { margin-right: 0; }
.trail-side { font-family: 'Lora', serif; font-size: 14px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; padding-top: 10px; }

/* ---------------------------------------------------------------- hub */
.hub-head { text-align: center; padding: 36px 0 18px; }
.hub-head .eyebrow { font-family: 'Cinzel', serif; letter-spacing: 4px; color: var(--muted); font-size: 13px; }
.hub-head h1 { font-family: 'Cinzel', serif; font-weight: 900; color: var(--gold); font-size: clamp(30px, 5vw, 44px); letter-spacing: 3px; text-transform: uppercase; }
.hub-head p { max-width: 640px; margin: 10px auto 0; color: var(--muted); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.hub-card { background: rgba(0, 0, 0, 0.18); border: 1px solid var(--gold-soft); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.hub-card h2 { font-family: 'Cinzel', serif; font-size: 22px; }
.hub-card h2 a { text-decoration: none; }
.hub-card .record { font-size: 13px; color: var(--muted); font-style: italic; flex: 1; }
.hub-links { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
    body { font-size: 14px; }
    .solo-app { padding: 0 10px 30px; }
    .zone-row { gap: 12px; }
    .topbar .title { min-width: 0; }
}

/* ---------------------------------------------------------------- page text */
.howto { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--gold-soft); }
.howto h2 { font-family: 'Cinzel', serif; color: var(--gold); font-size: 20px; margin-bottom: 10px; }
.howto p { max-width: 760px; margin-bottom: 10px; color: var(--muted); }
.solo-footer {
    display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center;
    margin: 26px 0 10px; padding-top: 14px; border-top: 1px solid rgba(201, 168, 76, 0.2);
    font-size: 14px;
}
.solo-footer a { color: var(--muted); text-decoration: none; }
.solo-footer a:hover { color: var(--gold); }
