/* Shared styles for the card-game shell (lobby, table, toast, timer). */
:root {
  --felt: #12231b;
  --felt-2: #0b1711;
  --gold: #e8c46a;
  --danger: #ff5d73;
  --ok: #3ddc97;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; }
body { background: var(--bg); color: var(--text); }
.muted { color: var(--text-muted); }
.center { text-align: center; }
#app { max-width: 560px; margin: 0 auto; padding: 12px 16px 96px; }
.btn { min-height: 44px; }
.t-big { width: 100%; margin-top: 10px; }
.t-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-muted); width: 100%; margin-top: 18px; }
.t-home, .t-lobby { display: flex; flex-direction: column; gap: 6px; }
.t-hero { text-align: center; margin: 12px 0 8px; }
.t-hero h1 { margin: 4px 0; font-size: 2rem; }
.t-icon { font-size: 3rem; line-height: 1; }
.t-field { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: .9rem; color: var(--text-muted); }
.t-field input, .t-field select, .t-joinrow input {
  min-height: 46px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); padding: 0 12px; font-size: 16px; width: 100%;
}
.t-joinrow { display: flex; gap: 8px; margin-top: 10px; }
.t-joinrow input { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; text-align: center; }
.t-joinrow .btn { flex: 0 0 auto; }
.t-err { color: var(--danger); min-height: 1.2em; text-align: center; }
.t-rules { margin-top: 14px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.t-rules summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.t-rules li { margin: 4px 0; }
.t-codebox { text-align: center; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.t-codebox strong { display: block; font-size: 2.6rem; letter-spacing: .25em; font-family: var(--mono); color: var(--accent); padding-left: .25em; }
.t-share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.t-players { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.t-players li { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.t-pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); opacity: .5; }
.t-dot.on { background: var(--ok); opacity: 1; }
.t-tag { font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: var(--border); color: var(--text-muted); }
.t-x { width: 44px; height: 44px; border: 0; background: transparent; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
.t-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
#t-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: #000c; color: #fff; padding: 10px 18px; border-radius: 99px; transition: .25s; z-index: 1000; max-width: 90vw; text-align: center; font-size: .95rem; }
#t-toast.show { opacity: 1; transform: translate(-50%, 0); }
#t-timer { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 999; background: transparent; }
#t-timer i { display: block; height: 100%; background: var(--accent); transition: background .3s; }
#t-timer.low i { background: var(--danger); }
#t-conn { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); background: var(--danger); color: #fff; padding: 6px 14px; border-radius: 99px; z-index: 1001; font-size: .85rem; }

/* game table */
.felt { background: radial-gradient(ellipse at 50% 40%, #1c3a2c 0%, var(--felt) 55%, var(--felt-2) 100%); border-radius: 22px; padding: 12px; color: #eef; position: relative; box-shadow: inset 0 0 40px #0008; }
.g-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.g-top .g-title { font-weight: 700; }
.g-icon-btn { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); font-size: 1rem; cursor: pointer; }
.g-actions { display: flex; gap: 8px; margin-top: 10px; }
.g-actions .btn { flex: 1; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.g-log { margin-top: 10px; font-size: .82rem; color: var(--text-muted); display: flex; flex-direction: column-reverse; gap: 2px; max-height: 7.5em; overflow: hidden; }
.g-status { text-align: center; min-height: 1.4em; margin: 6px 0; font-weight: 600; }
.g-status.me { color: var(--gold); }
.overlay { position: fixed; inset: 0; background: #000a; display: flex; align-items: center; justify-content: center; z-index: 500; padding: 16px; animation: fade .25s; }
.overlay .sheet { background: var(--bg-elevated); color: var(--text); border-radius: var(--radius); padding: 18px; width: 100%; max-width: 420px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.sheet h2 { margin: 0 0 10px; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet td, .sheet th { padding: 6px 4px; border-bottom: 1px solid var(--border); text-align: left; }
.sheet td:last-child, .sheet th:last-child { text-align: right; }
@keyframes fade { from { opacity: 0; } }
@keyframes flyUp { from { transform: translateY(120px) scale(.7) rotate(-8deg); opacity: 0; } }
@keyframes flyDown { from { transform: translateY(-120px) scale(.7) rotate(8deg); opacity: 0; } }
@keyframes pop { 50% { transform: scale(1.12); } }
.fly-up { animation: flyUp .35s cubic-bezier(.2,.8,.3,1.1) both; }
.fly-down { animation: flyDown .35s cubic-bezier(.2,.8,.3,1.1) both; }
.pulse { animation: pop .6s ease; }
@media (prefers-reduced-motion: reduce) { .fly-up, .fly-down, .pulse { animation: none; } }
body.game-fullscreen #app, body[data-screen="game"] #app { padding-bottom: 24px; }
