/* Lobby: painted scene and game illustrations, with compact responsive enamel controls.
   Wallet coordinates come from img/meta.json. Fonts are bundled (OFL). */
@font-face { font-family: "Cinzel"; font-weight: 800; font-display: swap; src: url("./fonts/cinzel-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Marcellus"; font-weight: 400; font-display: swap; src: url("./fonts/marcellus-latin-400-normal.woff2") format("woff2"); }

:root {
	--night: #01071d;
	--line: rgba(226, 176, 74, 0.32);
	--gold: #e2b04a;
	--gold-hi: #ffe9a8;
	--ivory: #fff6dc;
	--dim: #a3aed0;
	--body: "Marcellus", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
	--display: "Cinzel", "Marcellus", serif;
	--col: 1120px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--night); }
body {
	min-height: 100dvh;
	background: url("./img/bg-portrait.jpg") top center / 100% auto no-repeat var(--night);
	color: var(--ivory);
	font: 16px/1.5 var(--body);
	padding: max(20px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
	background-attachment: fixed;
}
@media (min-aspect-ratio: 1/1) { body { background-image: url("./img/bg-landscape.jpg"); } }
[hidden] { display: none !important; }
header, main, footer, .daily, .section { max-width: var(--col); margin-left: auto; margin-right: auto; }
img { display: block; }

/* ---- header */
header { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: nowrap; padding: 4px 0 24px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .emblem { width: 56px; height: 56px; flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); }
h1 { margin: 0; font: 800 clamp(20px, 5.4vw, 30px)/1.1 var(--display); letter-spacing: 0.08em; color: var(--gold-hi); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
.brand p { margin: 2px 0 0; color: var(--dim); font-size: 14px; }

/* balance plaque: the coin sits in the round socket, the number on the dark field (meta.json wallet) */
.wallet {
	position: relative; flex: none; width: clamp(176px, 48vw, 232px); aspect-ratio: 2.8624; container-type: inline-size;
	background: url("./img/wallet.png") center / 100% 100% no-repeat;
	filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.55));
}
.wallet .coin { position: absolute; left: 6.4%; top: 55%; width: 13.8%; height: auto; transform: translateY(-50%); }
.wallet b {
	position: absolute; left: 26%; right: 7%; top: 55%; transform: translateY(-50%); text-align: center;
	font: 800 10.4cqw/1 var(--display); color: #fff; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; white-space: nowrap;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.wallet.bump { animation: bump 0.5s ease; }
@keyframes bump { 30% { transform: scale(1.07); filter: drop-shadow(0 0 16px rgba(255, 210, 110, 0.9)); } }
.coin.fly { position: fixed; left: 0; top: 0; z-index: 5; width: 22px; height: 22px; pointer-events: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }

/* ---- buttons: scalable gold primary actions */
button { font: inherit; cursor: pointer; }
.go {
	flex: none; min-width: 110px; height: 44px; padding: 0 22px; border: 1px solid #ffe3a2; border-radius: 24px;
	background: linear-gradient(180deg,#ffe6a6,#e2b351 52%,#b7802c);
	color: #241907; font: 600 15px/1 var(--body); letter-spacing: 0.06em; text-decoration: none; white-space: nowrap;
	display: inline-flex; align-items: center; justify-content: center;
	text-shadow: 0 1px #fff7; box-shadow: inset 0 1px 0 #fff8,0 4px 14px #0003;
	filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.5));
	transition: transform 0.12s ease, filter 0.12s ease;
}
.go:hover { filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.5)) brightness(1.12); }
.go:active { background: linear-gradient(180deg,#ba862f,#edc672); transform: translateY(1px) scale(0.98); }
.go:disabled { background: #25314b; border-color: #70809966; color: #9aa7c0; cursor: default; filter: none; transform: none; }
.go.big { height: 56px; min-width: 220px; font-size: 18px; letter-spacing: 0.1em; }
.plain { min-height: 48px; padding: 0 18px; border-radius: 24px; background: rgba(8, 16, 52, 0.7); color: var(--gold-hi); border: 1px solid var(--line); font-size: 14px; }
.plain:hover { border-color: var(--gold); }
.plain:active { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

/* ---- daily reward: seven compact tiles at every viewport width */
.daily { position: relative; container-type: inline-size; margin-top: 4px; border: 1px solid rgba(226,176,74,.5); border-radius: 18px; background: linear-gradient(120deg,rgba(19,39,77,.94),rgba(5,15,40,.94)); box-shadow: 0 12px 40px #0004, inset 0 0 0 5px #e2b04a08; }
.daily-in { position: relative; padding: 18px 24px 22px; }
.daily-head { display: flex; align-items: center; gap: 10px 12px; }
.daily-head > div { flex: 1; min-width: 0; }
#chest { width: 64px; height: auto; flex: none; margin: -6px 0 -2px -4px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5)); }
.daily h2 { margin: 0; font: 400 clamp(18px, 5cqw, 24px)/1.2 var(--body); letter-spacing: 0.1em; color: var(--gold-hi); }
.daily p { margin: 3px 0 0; color: var(--dim); font-size: clamp(12px, 3.4cqw, 14px); line-height: 1.35; font-variant-numeric: tabular-nums; }
.daily ol { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; justify-items: stretch; }
/* Tile padding uses pixels: cqw here would resolve against the whole panel, not the tile. */
.daily li {
	position: relative; width: 100%; min-width: 0; height: 100px; container-type: inline-size;
	background: linear-gradient(150deg,#1b2a48,#0a142c); border: 1px solid #7182a044; border-radius: 10px;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px 2px;
	color: var(--dim);
}
.daily li.now { background: linear-gradient(145deg,#644723,#20243a); border-color: var(--gold); color: var(--gold-hi); box-shadow: inset 0 0 16px #e2b04a12, 0 0 12px #e2b04a18; }
.daily li.done { border-color: #b9935277; background: #182238; }
.daily li.done::after { content: "✓"; position: absolute; right: 5px; bottom: 3px; color: var(--gold); font-size: 12px; }
.daily li.done > * { opacity: 0.62; }
.daily li .day { font-size: 12px; line-height: 1; white-space: nowrap; }
.daily li .coin { width: 24px; height: auto; }
.daily li b { font: 800 18px/1 var(--display); color: var(--ivory); font-variant-numeric: tabular-nums; }
.daily li.now b { color: #fff; }
.daily li .mark { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* the state is said to screen readers; the tile shows it */
@media (max-width: 600px) {
	body { padding: max(14px, env(safe-area-inset-top)) 14px 24px; }
	header { gap: 8px; padding-bottom: 18px; }
	.brand { gap: 7px; }
	.brand .emblem { width: 36px; height: 36px; }
	.brand h1 { font-size: clamp(14px,4.2vw,20px); letter-spacing: .025em; }
	.brand p { font-size: 10px; }
	.wallet { width: clamp(112px,33vw,150px); }
	.daily-in { padding: 12px 10px 14px; }
	.daily-head { gap: 8px; }
	#chest { width: 42px; margin: 0; }
	.daily h2 { font-size: 17px; letter-spacing: .04em; }
	.daily p { font-size: 10px; line-height: 1.4; max-width: 19em; }
	.daily ol { gap: 4px; margin-top: 12px; }
	.daily li { height: 82px; gap: 7px; border-radius: 7px; }
	.daily li .day { font-size: 10px; }
	.daily li .coin { width: 18px; }
	.daily li b { font-size: 14px; }
	.daily .go { min-width: 78px; height: 44px; padding: 0 10px; font-size: 12px; }
}

/* ---- games */
.section { margin-top: 26px; margin-bottom: 0; display: flex; align-items: center; gap: 14px; font: 400 18px/1 var(--body); letter-spacing: 0.3em; color: var(--gold-hi); }
.section::before, .section::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.section::after { transform: scaleX(-1); }
main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 18px 0 26px; justify-items: center; }
/* Game illustrations retain their proportions; titles and actions stay in normal document flow. */
.card {
	position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; container-type: inline-size; overflow: hidden; border-radius: 16px; border: 1px solid #d4aa5c99; background: linear-gradient(145deg,#122449,#060e25); box-shadow: inset 0 0 0 3px #d4aa5c0a;
	color: inherit; text-decoration: none;
	filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.55));
	transition: transform 0.18s ease, filter 0.18s ease;
}
a.card:hover { transform: translateY(-4px); filter: drop-shadow(0 20px 24px rgba(0, 0, 0, 0.6)) brightness(1.06); }
a.card:active { transform: translateY(-1px) scale(0.99); }
.shot { position: relative; width: 100%; aspect-ratio: 1.45; overflow: hidden; background: #050816; border-bottom: 1px solid #d4aa5c66; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.shot .blank { position: absolute; inset: 0; display: grid; place-items: center; font: 800 6cqw var(--display); color: var(--gold-hi); letter-spacing: 0.1em; text-align: center; }
.meta { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px 14px 24px; text-align: center; }
.meta h2 { margin: 0; font: 800 clamp(16px,5.6cqw,23px)/1.2 var(--display); letter-spacing: 0.04em; color: var(--gold-hi); white-space: nowrap; }
.meta p { margin: 0; color: var(--ivory); font-size: clamp(12px, 4.1cqw, 15px); line-height: 1.4; }
.meta .go { width: 72%; height: 44px; margin-top: 8px; font-size: 15px; }
@media (max-width: 700px) { main { grid-template-columns: 1fr; gap: 18px; } .shot { aspect-ratio: 1.85; } .meta { padding: 16px; gap: 6px; } .meta h2 { font-size: 20px; } .meta .go { width: 64%; margin-top: 6px; } .card.soon .shot { aspect-ratio: 2.5; } }
.card.soon { filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.55)) saturate(0.75); }
.card.soon .meta h2 { color: #cfd6ee; }
.card.soon .meta p { color: var(--dim); }
/* Keep playable cards readable on tablets; the future game is secondary. */
@media (min-width: 701px) and (max-width: 1000px) {
	main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
	.card.soon { grid-column: 1 / -1; flex-direction: row; min-height: 120px; }
	.card.soon .shot { width: 34%; aspect-ratio: 2; border-bottom: 0; border-right: 1px solid #d4aa5c66; }
	.card.soon .meta { padding: 18px; }
}
/* Short landscape windows should expose game choices without a full-screen reward block. */
@media (min-width: 701px) and (max-height: 600px) {
	body { padding-top: 12px; }
	header { padding-bottom: 12px; }
	.brand .emblem { width: 42px; height: 42px; }
	.brand h1 { font-size: 24px; }
	.brand p { font-size: 11px; }
	.wallet { width: 172px; }
	.daily-in { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 18px; padding: 14px 18px; }
	.daily-head { display: grid; grid-template-columns: 38px 1fr; gap: 5px 10px; }
	#chest { width: 38px; margin: 0; }
	.daily h2 { font-size: 19px; }
	.daily p { font-size: 11px; }
	.daily-head .go { grid-column: 1 / -1; justify-self: start; height: 44px; min-width: 136px; font-size: 13px; }
	.daily ol { margin: 0; gap: 5px; }
	.daily li { height: 86px; }
	.section { margin-top: 18px; }
	main { padding-top: 14px; }
}
.note { grid-column: 1 / -1; color: var(--dim); border: 1px dashed var(--line); border-radius: 14px; padding: 18px; background: rgba(4, 10, 40, 0.7); }

/* ---- footer */
footer { opacity: .8; border-top: 1px solid var(--line); padding-top: 16px; color: var(--dim); font-size: 13px; }
footer p { margin: 0 0 6px; max-width: 60ch; }
footer p:first-child { color: var(--ivory); }
.seat { display: flex; align-items: center; gap: 12px; font-size: 14px; margin-top: 14px; }
.seat b { color: var(--ivory); font-weight: 400; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
