:root {
  --bg: #17130f;
  --panel: #241d17;
  --panel-2: #30261e;
  --ink: #f4eadc;
  --muted: #bcae9d;
  --accent: #e4a94f;
  --accent-2: #f2cf7c;
  --danger: #d86953;
  --ok: #8cc783;
  --line: rgba(244, 234, 220, 0.16);
  --shadow: 0 16px 50px rgba(0,0,0,.36);
  font-family: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html, body { margin:0; min-height:100%; background: radial-gradient(circle at top, #312116 0, var(--bg) 58%); color: var(--ink); }
button, input, select { font: inherit; }
.app-shell { width:min(1040px, 100%); margin:0 auto; padding: 18px; }
.card { background: linear-gradient(180deg, rgba(48,38,30,.96), rgba(36,29,23,.96)); border:1px solid var(--line); border-radius:22px; padding:22px; box-shadow: var(--shadow); }
.hero { text-align:center; margin:24px auto; max-width:720px; }
.logo { font-size: clamp(2.4rem, 8vw, 5rem); color: var(--accent-2); letter-spacing:.06em; margin:10px 0; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.subtitle { color: var(--muted); font-size:1.05rem; }
.grid { display:grid; gap:16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); align-items:start; gap:20px; }
.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.center { text-align:center; justify-content:center; }
.small { color: var(--muted); font-size:.92rem; }
.big { font-size:1.35rem; }
.btn { border:1px solid var(--line); background:#3d2d20; color:var(--ink); border-radius:14px; padding:10px 14px; cursor:pointer; transition:.15s transform,.15s background; }
.btn:hover { transform: translateY(-1px); background:#4a3626; }
.btn.primary { background: linear-gradient(180deg, #d99539, #9f6227); border-color: rgba(255,217,137,.45); font-weight:bold; }
.btn.danger { background:#653126; border-color:rgba(216,105,83,.55); }
.btn.ghost { background:transparent; }
.btn:disabled { opacity:.55; cursor:not-allowed; transform:none; }
.input, select { width:100%; background:#16110d; color:var(--ink); border:1px solid var(--line); border-radius:14px; padding:11px 12px; outline:none; }
.input:focus { border-color: var(--accent); }
.field { display:grid; gap:8px; text-align:left; }
.label { color: var(--accent-2); font-weight:bold; }
.code { font-size:3rem; color:var(--accent-2); letter-spacing:.12em; font-weight:bold; }
.qr { background:#fff; border-radius:12px; padding:8px; width:150px; height:150px; object-fit:contain; }
.lobby-card { display:flex; flex-direction:column; align-items:center; text-align:center; padding:26px 24px; }
.lobby-title { margin:0 0 18px; }
.lobby-code { margin-bottom:18px; line-height:1; text-shadow:0 2px 0 rgba(0,0,0,.2); }
.lobby-instructions { margin:0 0 18px; }
.lobby-qr { margin-bottom:20px; }
.invite-url { max-width:100%; overflow-wrap:anywhere; margin:0 0 26px; }
.players-title { align-self:stretch; text-align:left; margin:0 0 12px; }
.players { align-self:stretch; list-style:none; padding:0; margin:0 0 22px; display:grid; gap:10px; }
.players li, .score-row { display:flex; justify-content:space-between; gap:12px; padding:13px 14px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.035); }
.info-message { align-self:stretch; border:1px solid rgba(228,169,79,.34); background:rgba(228,169,79,.09); color:#f2d69a; border-radius:14px; padding:11px 13px; margin-bottom:22px; }
.start-btn { min-width:170px; padding:12px 20px; font-size:1.05rem; }
.settings-card { padding:26px 24px; }
.settings-title { margin:0 0 22px; }
.mode-selector { margin-bottom:24px; gap:12px; }
.settings-grid { gap:16px; }
.settings-grid .field, .settings-grid label.row { margin:0; }
.timer-wrap { display:grid; place-items:center; margin:14px auto; }
.timer { width:120px; height:120px; border-radius:50%; border:7px solid rgba(228,169,79,.25); display:grid; place-items:center; color:var(--accent-2); font-size:2.2rem; font-weight:bold; box-shadow: inset 0 0 0 2px rgba(0,0,0,.22); }
.timer.smalltimer { width:58px; height:58px; font-size:1rem; border-width:4px; }
.topbar { position:sticky; top:0; z-index:4; display:flex; justify-content:space-between; align-items:center; gap:14px; padding:14px 18px; margin:-18px -18px 16px; background:rgba(23,19,15,.88); backdrop-filter: blur(10px); border-bottom:1px solid var(--line); }
.iconbtn { width:44px; height:44px; border-radius:50%; background:#30261e; border:1px solid var(--line); color:var(--accent-2); cursor:pointer; }
.modal-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.68); z-index:30; display:grid; place-items:center; padding:16px; }
.modal { width:min(760px,100%); max-height:90vh; overflow:auto; }
.host-tools { border:1px dashed rgba(228,169,79,.45); background:rgba(228,169,79,.06); }
.host-control-btn { font-size:1rem; opacity:.92; }
.host-control-section { border:1px solid rgba(228,169,79,.22); background:rgba(255,255,255,.035); border-radius:16px; padding:14px; margin:14px 0; }
.host-control-section h3 { margin:0 0 10px; color:var(--accent-2); }
.right { justify-content:flex-end; }
.danger-zone { border:1px solid rgba(216,105,83,.45); background:rgba(216,105,83,.08); border-radius:16px; padding:12px 14px; margin:14px 0; }
.danger-zone summary { cursor:pointer; color:#ffd7cf; font-weight:bold; }
.pause-card { border-color:rgba(228,169,79,.55); background:linear-gradient(180deg, rgba(68,48,28,.96), rgba(36,29,23,.96)); }
.phase-title { color:var(--accent-2); font-size:clamp(1.6rem,6vw,3rem); margin:.2em 0; }
.word { font-size: clamp(2rem, 10vw, 4rem); color:var(--accent-2); margin:8px 0; }
.draw-layout { display:grid; gap:12px; }
.canvas-wrap { background:#efe8db; border-radius:18px; padding:8px; touch-action:none; }
#drawCanvas { display:block; width:100%; height:min(62vh, 520px); background:#fffaf0; border-radius:12px; touch-action:none; }
.swatch { width:34px; height:34px; border-radius:50%; border:2px solid rgba(255,255,255,.5); cursor:pointer; }
.swatch.active { outline:3px solid var(--accent); }
.brush.active { background:var(--accent); color:#21160f; }
.gallery-img, .mosaic-img { background:#fffaf0; border-radius:14px; width:100%; object-fit:contain; border:1px solid rgba(0,0,0,.2); }
.gallery-img { max-height:60vh; }
.mosaic { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap:12px; }
.tile { background:rgba(255,255,255,.045); border:1px solid var(--line); border-radius:16px; padding:10px; }
.tile.selected-gold { outline:3px solid #f4c95d; }
.tile.selected-silver { outline:3px solid #cfd3d8; }
.tile.selected-bronze { outline:3px solid #bd7f45; }
.medals { display:grid; gap:10px; }
.medal-row { display:grid; grid-template-columns: 90px 1fr; gap:10px; align-items:center; }
.warning { border:1px solid rgba(216,105,83,.5); background:rgba(216,105,83,.12); color:#ffd7cf; border-radius:14px; padding:10px; }
.success-message { border:1px solid rgba(80,190,123,.55); background:rgba(80,190,123,.13); color:#d9ffe5; border-radius:14px; padding:10px 12px; font-weight:600; }
@media (max-width: 720px) { .grid.two { grid-template-columns:1fr; gap:16px; } .app-shell { padding:10px; } .card { padding:18px; border-radius:18px; } .lobby-card, .settings-card { padding:22px 18px; } .code { font-size:2.4rem; } .topbar { margin:-10px -10px 14px; padding:12px 14px; gap:10px; } .iconbtn { width:42px; height:42px; } }
