@font-face { font-family: 'Lalezar'; src: url(/fonts/lalezar.woff) format('woff'); font-display: swap; }
@font-face { font-family: 'Readex Pro'; src: url(/fonts/readex.woff) format('woff'); font-weight: 160 700; font-display: swap; }
:root {
  --coral: #FF5A3C; --cream: #FFF4E0; --ink: #1B1230; --yel: #FFD34D; --grn: #16A06A; --blu: #2F7BFF; --white: #FFFFFF;
  --muted: #5A4E6A; --soft: #6B6178;
  font-family: 'Readex Pro', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--cream); transition: background .25s; }
body.coral { background: var(--coral); }
#app { max-width: 480px; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); min-height: 100vh; display: flex; flex-direction: column; gap: 16px; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
.lz { font-family: 'Lalezar', 'Readex Pro', sans-serif; font-weight: 400; }

/* logo */
.logo { display: inline-block; font-family: 'Lalezar', sans-serif; line-height: 1.15; color: var(--cream); transform: rotate(-5deg);
  --d: var(--ink); --k: 2px;
  text-shadow: var(--k) 0 0 var(--d), calc(-1 * var(--k)) 0 0 var(--d), 0 calc(-1 * var(--k)) 0 var(--d), var(--k) var(--k) 0 var(--d), calc(-1 * var(--k)) var(--k) 0 var(--d),
    0 calc(2 * var(--k)) 0 var(--d), 0 calc(3 * var(--k)) 0 var(--d), 0 calc(4 * var(--k)) 0 var(--d), 0 calc(5 * var(--k)) 0 var(--d), 0 calc(8 * var(--k)) calc(6 * var(--k)) rgba(0,0,0,.22); }
.logo.xl { font-size: 92px; --k: 2px; }
.logo.sm { font-size: 40px; --k: 1px; }
.logo.c { color: var(--coral); }

/* buttons */
.btn { appearance: none; cursor: pointer; width: 100%; border: 2.5px solid var(--ink); border-radius: 18px; transition: transform .08s, box-shadow .08s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink) !important; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-poster { height: 64px; border-width: 3px; border-radius: 20px; background: var(--cream); font-family: 'Lalezar', sans-serif; font-size: 26px; box-shadow: 0 6px 0 var(--ink); }
.btn-dark { height: 58px; border-width: 3px; border-radius: 20px; background: var(--ink); color: var(--cream); font-family: 'Lalezar', sans-serif; font-size: 22px; box-shadow: 0 6px 0 #0B0614; }
.btn-coral { height: 60px; background: var(--coral); color: var(--white); font-family: 'Lalezar', sans-serif; font-size: 24px; box-shadow: 0 5px 0 var(--ink); }
.btn-white { height: 54px; background: var(--white); font-weight: 700; font-size: 16px; box-shadow: 0 5px 0 var(--ink); }
.btn-green { background: var(--grn); color: var(--white); }
.btn-sm { width: auto; height: 44px; padding: 0 16px; border-radius: 14px; font-size: 15px; font-weight: 700; box-shadow: 0 4px 0 var(--ink); }
.btn-ghost { width: auto; height: 40px; padding: 0 14px; border-radius: 12px; border-width: 2px; background: var(--white); font-weight: 700; font-size: 14px; }
.icon-btn { width: 46px; height: 46px; padding: 0; border-radius: 14px; background: var(--cream); box-shadow: 0 4px 0 var(--ink); }

/* surfaces */
.card { background: var(--white); border: 2.5px solid var(--ink); border-radius: 20px; box-shadow: 5px 5px 0 var(--ink); }
.card-poster { background: var(--cream); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 6px 0 var(--ink); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.pad { padding: 16px; }
.prompt { background: var(--coral); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 22px; padding: 22px 20px; box-shadow: 6px 6px 0 var(--ink); font-family: 'Lalezar', sans-serif; font-size: 30px; line-height: 1.35; overflow-wrap: anywhere; }
.prompt.sm { font-size: 22px; padding: 14px 16px; border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); }
.chip { font-size: 13px; font-weight: 700; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.chip.yel { background: var(--yel); }
.chip.dark { background: var(--ink); color: var(--cream); }
.chip.coral { background: var(--coral); color: var(--white); }
.timer { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; background: var(--yel); border: 2.5px solid var(--ink); border-radius: 12px; padding: 6px 12px; font-weight: 800; font-size: 20px; box-shadow: 3px 3px 0 var(--ink); min-width: 74px; justify-content: center; direction: ltr; }
.timer.low { background: var(--coral); color: var(--white); }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-weight: 700; font-size: 15px; }
.on-coral { color: var(--cream); }

/* inputs */
.input { width: 100%; height: 56px; border-radius: 16px; border: 2.5px solid var(--ink); background: var(--white); padding: 0 16px; font-size: 20px; font-weight: 700; outline: none; }
.input:focus { box-shadow: 0 0 0 3px var(--yel); }
textarea.input { height: auto; min-height: 120px; padding: 14px 16px; resize: none; line-height: 1.5; }
.code-input { text-align: center; font-family: 'Lalezar', sans-serif; font-size: 40px; letter-spacing: 10px; direction: ltr; text-transform: uppercase; height: 70px; }

/* colours & players */
.colors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; justify-items: center; }
.cdot { width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--ink); cursor: pointer; padding: 0; }
.cdot.on { box-shadow: 0 0 0 3px var(--cream), 0 0 0 6px var(--ink); }
.pdot { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); color: var(--white); display: inline-flex; align-items: center; justify-content: center; font-family: 'Lalezar', sans-serif; font-size: 18px; flex: none; line-height: 1; }
.pdot.lg { width: 46px; height: 46px; font-size: 22px; border-width: 2.5px; }
.pdot.xl { width: 108px; height: 108px; font-size: 52px; border-width: 4px; box-shadow: 0 6px 0 var(--ink); }
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pl { display: flex; align-items: center; gap: 8px; background: var(--white); border: 2.5px solid var(--ink); border-radius: 16px; padding: 8px 10px; box-shadow: 3px 3px 0 var(--ink); min-width: 0; }
.pl.off { opacity: .45; }
.pl .nm { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .x { margin-inline-start: auto; border: 0; background: none; font-size: 18px; font-weight: 700; cursor: pointer; padding: 0 4px; color: var(--soft); }

/* segmented */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 2.5px solid var(--ink); border-radius: 16px; overflow: hidden; background: var(--white); }
.seg button { height: 46px; border: 0; background: var(--white); font-weight: 700; font-size: 15px; cursor: pointer; }
.seg button + button { border-right: 2.5px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--cream); }

/* game rows */
.game { display: flex; align-items: stretch; background: var(--white); border: 2.5px solid var(--ink); border-radius: 20px; overflow: hidden; box-shadow: 5px 5px 0 var(--ink); }
.game.poster { background: var(--cream); border-width: 3px; box-shadow: 0 5px 0 var(--ink); }
.game .gi { width: 70px; border-left: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; flex: none; }
.game .gb { flex: 1; min-width: 0; padding: 12px 14px; }
.game .gt { font-family: 'Lalezar', sans-serif; font-size: 23px; line-height: 1.2; display: flex; align-items: center; gap: 8px; }
.game .gs { font-size: 13px; font-weight: 500; color: #4B3F5C; }
.game .ga { display: flex; align-items: center; padding-inline-end: 12px; }
.game.soon .gi { filter: saturate(.55); }
.game.soon .gs { opacity: .8; }

/* code card */
.codecard { background: var(--coral); border: 2.5px solid var(--ink); border-radius: 24px; padding: 18px; box-shadow: 6px 6px 0 var(--ink); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.roomcode { font-family: 'Lalezar', sans-serif; font-size: 64px; line-height: 1; letter-spacing: 10px; color: var(--cream); direction: ltr; text-shadow: 0 4px 0 var(--ink); }

/* answers */
.ans { width: 100%; text-align: right; background: var(--white); border: 2.5px solid var(--ink); border-radius: 18px; padding: 20px; font-size: 21px; font-weight: 700; box-shadow: 5px 5px 0 var(--ink); cursor: default; display: flex; flex-direction: column; gap: 12px; position: relative; overflow-wrap: anywhere; }
button.ans { cursor: pointer; }
button.ans:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.ans.pick { background: var(--yel); }
.ans.win { background: var(--yel); box-shadow: 6px 6px 0 var(--ink); }
.ans.lose { opacity: .75; box-shadow: 3px 3px 0 var(--ink); }
.ans.mine { border-style: dashed; }
.ans.hidden { font-style: italic; opacity: .6; }
.ans .who { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.ans .pts { margin-inline-start: auto; font-family: 'Lalezar', sans-serif; font-size: 28px; }
.ans .badge { position: absolute; top: -14px; left: 16px; background: var(--coral); color: var(--white); border: 2.5px solid var(--ink); border-radius: 999px; padding: 2px 14px; font-family: 'Lalezar', sans-serif; font-size: 18px; transform: rotate(-4deg); animation: pop .5s ease; }
.bk { font-size: 12px; font-weight: 700; background: var(--cream); border: 2px solid var(--ink); border-radius: 999px; padding: 0 8px; align-self: flex-start; }
@keyframes pop { 0% { transform: scale(.3) rotate(-4deg); } 70% { transform: scale(1.15) rotate(-4deg); } 100% { transform: scale(1) rotate(-4deg); } }

/* progress */
.bar { height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grn); transition: width .4s; }

/* ranking */
.rank { display: flex; flex-direction: column; gap: 8px; }
.rk { display: flex; align-items: center; gap: 12px; background: var(--cream); border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px 14px; }
.rk .n { font-family: 'Lalezar', sans-serif; font-size: 22px; width: 22px; }
.rk .s { margin-inline-start: auto; font-family: 'Lalezar', sans-serif; font-size: 22px; }
.rk.first { background: var(--yel); }

/* banner, toast, sheet */
.banner { position: sticky; top: 8px; z-index: 5; background: var(--ink); color: var(--cream); font-weight: 700; text-align: center; padding: 8px 12px; border-radius: 12px; }
#toast { position: fixed; inset-inline: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: 448px; margin: 0 auto; background: var(--ink); color: var(--cream); font-weight: 700; padding: 12px 16px; border-radius: 14px; text-align: center; transform: translateY(160%); transition: transform .25s; z-index: 20; border: 2.5px solid var(--ink); }
#toast.on { transform: none; }
.modal { position: fixed; inset: 0; background: rgba(27, 18, 48, .55); display: flex; align-items: flex-end; z-index: 10; }
.sheet { background: var(--cream); border-top: 3px solid var(--ink); border-radius: 26px 26px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); width: 100%; max-width: 480px; margin: 0 auto; max-height: 92vh; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.offer { position: relative; display: flex; align-items: center; gap: 12px; background: var(--white); border: 2.5px solid var(--ink); border-radius: 18px; padding: 14px 16px; box-shadow: 4px 4px 0 var(--ink); text-decoration: none; }
.offer.hot { background: var(--yel); }
.offer .on { font-family: 'Lalezar', sans-serif; font-size: 22px; line-height: 1.2; }
.offer .pr { margin-inline-start: auto; font-family: 'Lalezar', sans-serif; font-size: 24px; white-space: nowrap; }
.offer .tag { position: absolute; top: -12px; left: 14px; background: var(--coral); color: var(--white); border: 2px solid var(--ink); border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 800; }

/* steps on intro */
.steps { display: flex; flex-direction: column; gap: 10px; }
.steps div { display: flex; align-items: center; gap: 12px; background: var(--white); border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px; font-weight: 700; box-shadow: 3px 3px 0 var(--ink); }
.steps b { width: 32px; height: 32px; border-radius: 10px; background: var(--yel); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: 'Lalezar', sans-serif; font-size: 18px; flex: none; }

/* TV screen */



body.tv .roomcode { font-size: 110px; }
.demo-tag { position: fixed; bottom: 8px; left: 8px; opacity: .85; z-index: 30; background: var(--ink); color: var(--cream); font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; }

/* blanks in prompts */
.blank { display: inline-block; min-width: 72px; border-bottom: 4px solid var(--ink); margin: 0 4px; transform: translateY(-6px); }

/* الذئاب */
body.night { background: #0B0614; color: #E9E3F5; }
body.night .chip { border-color: #3A2F55; }
body.night .timer { background: #241A3D; color: #E9E3F5; border-color: #3A2F55; box-shadow: none; }
body.night .btn-ghost { background: #17112A; color: #E9E3F5; border-color: #3A2F55; }
.narr { background: var(--white); border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px 14px; font-weight: 600; font-size: 15px; line-height: 1.7; box-shadow: 3px 3px 0 var(--ink); }
body.night .narr { background: #17112A; border-color: #3A2F55; color: #CFC6E2; box-shadow: none; }
.ncard { background: #17112A; border: 2px solid #3A2F55; border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; color: #E9E3F5; align-items: stretch; }
.ncard.center { align-items: center; text-align: center; }
.nbtn { height: 54px; background: #2A1F47; color: #E9E3F5; border-color: #4A3D6B; font-weight: 700; font-size: 17px; }
.nbtn.sel { background: #3F8F64; }
.warn { background: #5A1E2B; border: 2px solid #A33B4F; border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: right; background: var(--white); border: 2.5px solid var(--ink); border-radius: 16px; padding: 8px 12px; font-size: 16px; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.opt.on { background: var(--yel); }
.ncard .opt { background: #241A3D; color: #E9E3F5; border-color: #4A3D6B; box-shadow: none; }
.ncard .opt.on { background: #6B2A3A; border-color: #C24A63; }
.on-pick { background: var(--yel) !important; }
.wstrip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.wp { display: flex; align-items: center; gap: 6px; background: var(--white); border: 2px solid var(--ink); border-radius: 12px; padding: 5px 8px; min-width: 0; flex-wrap: wrap; }
.wp .pdot { width: 28px; height: 28px; font-size: 15px; }
.wp .nm { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.wp .tags { display: inline-flex; gap: 2px; }
.wp .rl { font-size: 11px; font-weight: 700; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 6px; width: 100%; text-align: center; }
.wp .rl.w { background: var(--coral); color: var(--white); }
.wp.dead { opacity: .5; text-decoration: line-through; }
.rolecard { position: relative; min-height: 260px; border: 3px solid var(--ink); border-radius: 24px; background: var(--ink); color: var(--cream); box-shadow: 0 6px 0 var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; cursor: pointer; overflow: hidden; }
.rolecard .cover, .rolecard .face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; }
.rolecard .face { opacity: 0; background: var(--cream); color: var(--ink); }
.rolecard .face.w { background: #3B0F1A; color: #FFE1E1; }
.rolecard.show .face { opacity: 1; }
.rolechip { position: relative; height: 44px; border: 2px dashed var(--ink); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; user-select: none; -webkit-user-select: none; touch-action: none; cursor: pointer; }
body.night .rolechip { border-color: #4A3D6B; color: #CFC6E2; }
.rolechip .face { display: none; }
.rolechip.show .cover { display: none; }
.rolechip.show .face { display: inline; }

/* home: game cards */
.gcard { display: flex; align-items: stretch; background: var(--cream); color: var(--ink); text-decoration: none; border: 3px solid var(--ink); border-radius: 24px; overflow: hidden; box-shadow: 0 6px 0 var(--ink); transition: transform .08s; }
.gcard:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--ink); }
.gcard .gc-ic, .gpick .gc-ic { width: 84px; flex: none; background: var(--tone); border-left: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.gcard .gc-b, .gpick .gc-b { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.gcard .gc-t { font-family: 'Lalezar', sans-serif; font-size: 30px; line-height: 1.15; }
.gcard .gc-s { font-size: 14px; font-weight: 600; color: #4B3F5C; }
.gc-m { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.gcard .gc-go { display: flex; align-items: center; padding-inline-end: 12px; color: var(--ink); }
.gcard .gc-go svg { transform: scaleX(-1); }
.gcard.soon .gc-ic { filter: saturate(.5); }
.gcard.soon .gc-t, .gcard.soon .gc-s { opacity: .75; }
.mchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; background: var(--white); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.mchip.light { background: rgba(255, 255, 255, .92); color: var(--ink); font-weight: 600; }

/* game page hero */
.ghero { background: var(--tone); color: var(--white); border: 3px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); padding: 22px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.ghero .lz { color: var(--white); text-shadow: 0 3px 0 var(--ink); }
.ghero .mchip { color: var(--ink); }
.ghero.sm { padding: 14px; align-items: stretch; text-align: right; gap: 10px; }
.gh-ic { width: 76px; height: 76px; border-radius: 22px; background: rgba(0, 0, 0, .18); border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.gh-ic.sm { width: 54px; height: 54px; border-radius: 16px; flex: none; }
.stepn { width: 28px; height: 28px; flex: none; border-radius: 50%; border: 2px solid var(--ink); color: var(--white); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.optrow { display: flex; flex-direction: column; gap: 8px; }

/* game switcher */
.gpick { display: flex; align-items: stretch; width: 100%; text-align: right; background: var(--white); border: 2.5px solid var(--ink); border-radius: 18px; overflow: hidden; padding: 0; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); font: inherit; color: var(--ink); }
.gpick .gc-ic { width: 64px; }
.gpick.on { background: var(--yel); }
.gpick[disabled] { opacity: .55; cursor: default; }
.ghero .btn { color: var(--ink); text-shadow: none; }

/* game identities */
.pat { background-color: var(--tone); background-image: var(--pat); background-size: auto; }
.emb { display: block; flex: none; user-select: none; }
.ghero > .emb { margin: -4px 0 -2px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.08)); }
.wm { font-family: 'Lalezar', sans-serif; font-weight: 400; line-height: 1.15; color: var(--cream); display: inline-block; --k: 1.5px;
  text-shadow: var(--k) 0 0 var(--ink), calc(-1 * var(--k)) 0 0 var(--ink), 0 calc(-1 * var(--k)) 0 var(--ink), var(--k) var(--k) 0 var(--ink), calc(-1 * var(--k)) var(--k) 0 var(--ink),
    0 calc(2 * var(--k)) 0 var(--deep), 0 calc(3 * var(--k)) 0 var(--deep), 0 calc(4 * var(--k)) 0 var(--ink); }
.wm .bang { color: var(--yel); font-weight: 400; display: inline-block; transform: rotate(12deg) translateY(-2px); }
.ghero .wm { --k: 2px; }
.gcard .wm, .gpick .wm { --k: 1.2px; }
.gcard .gc-ic { width: 96px; }
.gcard .gc-ic .emb { filter: drop-shadow(0 2px 0 rgba(0,0,0,.1)); }
.game .gi.pat { display: flex; align-items: center; justify-content: center; }
.gcard .wm, .gpick .wm { color: var(--tone); }

/* ---------- QR to join ---------- */
.code-and-qr { display: flex; align-items: center; justify-content: center; gap: 18px; width: 100%; }
.qrinline { display: none; width: 132px; height: 132px; flex: none; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 4px 0 var(--ink); }
.qrinline svg, .qrbig svg { display: block; width: 100%; height: 100%; }
.qrhint { display: none; color: var(--cream); font-weight: 600; font-size: 14px; text-align: center; }
.qrbig { width: min(78vw, 320px); aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 6px 0 var(--ink); }
.qrbtn { flex: none; width: 48px; padding: 0; }
body.tv .qrinline { display: block; width: 260px; height: 260px; }
body.tv .qrhint { display: block; font-size: 22px; }

/* ---------- reactions ---------- */
.reacts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.reacts button { height: 50px; font-size: 26px; line-height: 1; border: 2.5px solid var(--ink); border-radius: 16px; background: var(--white); box-shadow: 0 4px 0 var(--ink); cursor: pointer; padding: 0; }
.reacts button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.reacts button.hit { animation: hit .3s ease; }
@keyframes hit { 50% { transform: scale(1.25); } }
#fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 15; }
#fx .fl { position: absolute; bottom: -60px; font-size: 44px; line-height: 1; animation: floatup 2.6s cubic-bezier(.2, .7, .3, 1) forwards; filter: drop-shadow(0 3px 0 var(--c, #1B1230)); }
body.tv #fx .fl { font-size: 80px; }
@keyframes floatup { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 12% { opacity: 1; transform: translate(calc(var(--dx) * .2), -12vh) scale(1.15); } 100% { transform: translate(var(--dx), -85vh) scale(1); opacity: 0; } }

/* ---------- stats (admin) ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--cream); border: 2px solid var(--ink); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; align-items: center; }
.kpi b { font-family: 'Lalezar', sans-serif; font-size: 28px; font-weight: 400; line-height: 1.1; }
.kpi span { font-size: 12px; font-weight: 700; }
table.stats { width: 100%; border-collapse: collapse; font-size: 14px; }
table.stats th, table.stats td { border-bottom: 1.5px solid #E6DCCB; padding: 6px 8px; text-align: center; white-space: nowrap; }
table.stats th { font-size: 12px; }

/* ---------- layout blocks (phone: one column, same as before) ---------- */
.cols, .col { display: flex; flex-direction: column; gap: 16px; }
.glist { display: flex; flex-direction: column; gap: 14px; }
.alist { display: flex; flex-direction: column; gap: 16px; }
.acell { display: flex; flex-direction: column; gap: 6px; }

/* ---------- big screens: a real desktop layout instead of the phone column ---------- */
@media (min-width: 900px) {
  body:not(.tv) #app { max-width: 1160px; padding: 32px 40px 48px; gap: 22px; }
  .modal { align-items: center; }
  .sheet { border: 3px solid var(--ink); border-radius: 28px; max-width: 540px; box-shadow: 0 10px 0 var(--ink); padding: 26px; }
  #toast { max-width: 520px; }
  .qrinline { display: block; }
  .qrhint { display: block; }
  .qrbtn { display: none; }
  .btn:hover:not(:disabled) { filter: brightness(1.04); }
  .gcard:hover, .gpick:hover:not([disabled]) { transform: translateY(-3px); box-shadow: 0 9px 0 var(--ink); }

  /* home: games side by side */
  body[data-screen=home] #app > .center .logo.xl { font-size: 128px; }
  .glist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
  .glist .gcard { flex-direction: column; }
  .glist .gcard .gc-ic { width: auto; height: 210px; border-left: 0; border-bottom: 3px solid var(--ink); }
  .glist .gcard .gc-ic .emb { width: 150px; height: 150px; }
  .glist .gcard .gc-b { padding: 18px 20px 20px; gap: 6px; }
  .glist .gcard .gc-t .wm { font-size: 38px !important; }
  .glist .gcard .gc-s { font-size: 16px; }
  .glist .gcard .gc-go { display: none; }
  body[data-screen=home] #app > .btn-dark { max-width: 460px; align-self: center; }
  body[data-screen=home] #app > .lz { text-align: center; font-size: 34px !important; }

  /* game page, lobby, results: two columns */
  .cols { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .cols.gpage .ghero { padding: 34px 26px; }
  .cols.gpage .ghero > .emb { width: 190px; height: 190px; }
  .cols.gpage .ghero .wm { font-size: 72px !important; }
  .cols.lobby .roomcode { font-size: 80px; }
  .cols.lobby .codecard { padding: 22px; }
  .cols.lobby .pl .nm { font-size: 16px; }
  .cols.results > .col:first-child { position: sticky; top: 24px; }

  /* playing: wider, bigger, answers side by side */
  body[data-screen=play]:not(.tv) #app { max-width: 980px; }
  body[data-screen=play] .prompt { font-size: 40px; padding: 30px 32px; }
  body[data-screen=play] .prompt.sm { font-size: 28px; }
  body[data-screen=play] .alist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  body[data-screen=play] .ans { font-size: 24px; min-height: 120px; justify-content: center; }
  body[data-screen=play] form[data-form=answer], body[data-screen=play] form[data-form=fanswer] { max-width: 760px; }
  body[data-screen=play] .wstrip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body[data-screen=play] .opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-screen=play] .rolecard { min-height: 320px; }
  body[data-screen=play] .reacts { max-width: 520px; align-self: center; width: 100%; }
}

/* ---------- TV / big shared screen ---------- */
body.tv #app { max-width: none; padding: 3vh 3vw; min-height: 100vh; }
body.tv .banner { position: fixed; top: 12px; inset-inline: 30%; }
.tvl { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 30vw, 520px); gap: 3vw; min-height: 94vh; align-items: stretch; }
.tv-main { display: flex; flex-direction: column; gap: 2.4vh; min-width: 0; }
.tvhero { flex-direction: row !important; align-items: center !important; text-align: right !important; gap: 28px !important; padding: 28px 34px !important; }
.tvhero .wm { --k: 3px; }
.tvh-t { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.tvh-s { font-size: 26px; font-weight: 700; color: #fff; }
.tvhero .mchip { font-size: 16px; padding: 3px 12px; }
.tv-status { margin-inline-start: auto; font-size: 24px; font-weight: 700; }
.tv-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-content: start; }
.tvp { display: flex; align-items: center; gap: 14px; background: var(--white); border: 3px solid var(--ink); border-radius: 22px; padding: 14px 18px; box-shadow: 0 5px 0 var(--ink); min-width: 0; min-height: 84px; animation: tvin .35s ease; }
.tvp .nm { font-weight: 700; font-size: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvp .chip { margin-inline-start: auto; font-size: 14px; }
.tvp.off { opacity: .45; }
.tvp.empty { background: transparent; border: 3px dashed #CDBFA8; box-shadow: none; color: #A08F76; font-weight: 700; font-size: 20px; justify-content: center; animation: none; }
@keyframes tvin { from { transform: scale(.85); opacity: 0; } }
.tv-join { background: var(--coral); border: 4px solid var(--ink); border-radius: 34px; box-shadow: 0 10px 0 var(--ink); padding: 3vh 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2vh; text-align: center; min-width: 0; }
.tv-join .logo { font-size: 44px; }
.tv-qr { width: min(100%, 38vh, 360px); aspect-ratio: 1; background: #fff; border: 4px solid var(--ink); border-radius: 24px; overflow: hidden; box-shadow: 0 8px 0 var(--ink); margin: 1vh 0; }
.tv-qr svg { display: block; width: 100%; height: 100%; }
.tv-step { color: var(--cream); font-weight: 700; font-size: 22px; }
.tv-or { color: var(--ink); font-weight: 800; font-size: 18px; background: var(--yel); border: 2.5px solid var(--ink); border-radius: 999px; padding: 0 14px; }
.tv-host { direction: ltr; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; padding: 6px 14px; font-weight: 800; font-size: clamp(16px, 1.5vw, 24px); max-width: 100%; overflow-wrap: anywhere; }
body.tv .tv-code { font-size: clamp(64px, 7vw, 110px); margin-top: .5vh; }

/* TV during a game and on results: the phone layout, scaled up to the screen (zoom keeps every proportion) */
body.tv[data-screen=play] #app, body.tv[data-screen=result] #app { max-width: 1100px; margin: 0 auto; padding: 2.5vh 24px; }
@media (min-width: 1280px) { body.tv[data-screen=play] #app, body.tv[data-screen=result] #app { zoom: 1.15; } }
@media (min-width: 1600px) { body.tv[data-screen=play] #app, body.tv[data-screen=result] #app { zoom: 1.4; } }
@media (min-width: 1900px) { body.tv[data-screen=play] #app, body.tv[data-screen=result] #app { zoom: 1.6; } }
@media (min-width: 2500px) { body.tv[data-screen=play] #app, body.tv[data-screen=result] #app { zoom: 2.2; } }
body.tv[data-screen=play] .alist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
body.tv[data-screen=play] .ans { min-height: 110px; justify-content: center; }
body.tv[data-screen=play] .prompt { font-size: 38px; }
body.tv[data-screen=play] .prompt.sm { font-size: 30px; }
body.tv[data-screen=play] .wstrip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.tv .bar { height: 16px; }
/* TV: the game content sits in the middle of the screen, header on top */
body.tv[data-screen=play] #app > .row:first-child { margin-bottom: auto; }
body.tv[data-screen=play] #app > :last-child { margin-bottom: auto; }
body.tv[data-screen=play] #app { gap: 3vh; }
body.tv[data-screen=play] .prompt[style] { font-size: 44px !important; }
body.tv .tvwait { display: flex; flex-direction: column; gap: 3vh; align-items: stretch; text-align: center; }
body.tv .tvwait > .lz { font-size: clamp(40px, 3.4vw, 60px); }
.tvp .st { margin-inline-start: auto; font-weight: 800; font-size: 18px; border: 2.5px solid var(--ink); border-radius: 999px; padding: 2px 12px; white-space: nowrap; }
.tvp.done .st { background: var(--grn); color: #fff; }
.tvp.busy .st { background: var(--yel); animation: blink 1.2s ease-in-out infinite; }
.tvp.busy { opacity: .85; }
@keyframes blink { 50% { opacity: .45; } }
body.tv .tv-status { font-size: 26px; }
/* TV results */
body.tv .pdot.xl { width: 130px; height: 130px; }
/* zoom scales vh too: keep the zoomed page exactly one screen tall */
body.tv[data-screen=play] #app, body.tv[data-screen=result] #app { min-height: 100vh; }
@media (min-width: 1280px) { body.tv[data-screen=play] #app, body.tv[data-screen=result] #app { min-height: calc(100vh / 1.15); } }
@media (min-width: 1600px) { body.tv[data-screen=play] #app, body.tv[data-screen=result] #app { min-height: calc(100vh / 1.4); } }
@media (min-width: 1900px) { body.tv[data-screen=play] #app, body.tv[data-screen=result] #app { min-height: calc(100vh / 1.6); } }
@media (min-width: 2500px) { body.tv[data-screen=play] #app, body.tv[data-screen=result] #app { min-height: calc(100vh / 2.2); } }
body.tv[data-screen=play] .tvwait { gap: 18px; }
body.tv[data-screen=play] .tvwait > .lz { font-size: 34px; }
body.tv[data-screen=play] .tv-players { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
body.tv[data-screen=play] .tvp { min-height: 0; padding: 8px 12px; gap: 10px; border-width: 2.5px; box-shadow: 0 4px 0 var(--ink); }
body.tv[data-screen=play] .tvp .nm { font-size: 18px; }
body.tv[data-screen=play] .tvp .pdot { width: 38px; height: 38px; font-size: 18px; }
body.tv[data-screen=play] .tvp .st { font-size: 13px; padding: 1px 8px; }
body.tv[data-screen=play] .tv-status { font-size: 18px; }
body.tv[data-screen=play] .prompt[style] { font-size: 40px !important; }
body.tv[data-screen=play] #app { gap: 18px; }
/* short screens (laptops, 720p TVs): the join card must fit without scrolling */
@media (max-height: 860px) {
  body.tv:not([data-screen=play]):not([data-screen=result]) #app { padding: 2vh 2.5vw; }
  .tvl { min-height: 96vh; }
  .tv-join { gap: .8vh; padding: 2vh 20px; }
  .tv-join .logo { display: none; }
  .tv-join > .lz { font-size: 34px !important; }
  .tv-qr { width: min(100%, 34vh, 300px); margin: .5vh 0; }
  .tv-step { font-size: 18px; }
  body.tv .tv-code { font-size: clamp(56px, 5.5vw, 90px); }
  .tvhero { padding: 18px 24px !important; }
  .tvhero .emb { width: 110px; height: 110px; }
  .tvhero .wm { font-size: 64px !important; }
  .tvp { min-height: 68px; padding: 10px 14px; }
  .tvp .nm { font-size: 22px; }
}

/* =====================================================================
   v2 · الطبقة الفاخرة: عمق، ملمس، أزرار تنضغط، صور، حركة
   ===================================================================== */
:root { --e-spring: cubic-bezier(.3, 1.5, .5, 1); --e-out: cubic-bezier(.2, .9, .3, 1); --hl: inset 0 2px 0 rgba(255,255,255,.5); --lo: inset 0 -4px 0 rgba(0,0,0,.13); }

/* backgrounds with depth and paper grain */
html { background: var(--cream); }
body, body.coral, body.night { background: none; }
html::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(120% 70% at 50% -10%, #FFFBF2 0%, var(--cream) 55%, #F7E6C8 100%); }
html:has(body.coral) { background: var(--coral); }
html:has(body.coral)::before { background: radial-gradient(130% 60% at 50% 0%, #FF8C5E 0%, #FF5A3C 45%, #E2401F 100%); }
html:has(body.night) { background: #0B0614; }
html:has(body.night)::before { background: radial-gradient(90% 50% at 70% 0%, #2A2163 0%, #120C33 55%, #07041A 100%); }
@supports not selector(html:has(body)) { body.coral { background: var(--coral); } body.night { background: #0B0614; } html::before { display: none; } }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; }
body.coral::before { background: url(/games/qolha-pat.svg); opacity: .55; -webkit-mask-image: linear-gradient(#000, transparent 70%); mask-image: linear-gradient(#000, transparent 70%); }
body.night::before { background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff8, transparent), radial-gradient(1.5px 1.5px at 70% 12%, #fff8, transparent), radial-gradient(1px 1px at 40% 70%, #fff6, transparent), radial-gradient(1px 1px at 85% 55%, #fff6, transparent), radial-gradient(1.5px 1.5px at 10% 85%, #fff5, transparent); }
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
#app { position: relative; z-index: 1; }

/* ---------- buttons: real 3D keys ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: transform .14s var(--e-spring), box-shadow .14s, filter .2s, background-color .2s; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.btn:active:not(:disabled) { transform: translateY(5px) scale(.985); box-shadow: var(--hl), 0 1px 0 var(--ink) !important; transition-duration: .05s; }
.btn:focus-visible, .gposter:focus-visible, .avopt:focus-visible { outline: 3px solid var(--yel); outline-offset: 3px; }
.btn-coral { background: linear-gradient(180deg, #FF7D57 0%, #FF5A3C 55%, #F2472A 100%); box-shadow: var(--hl), var(--lo), 0 6px 0 var(--ink); text-shadow: 0 2px 0 rgba(27,18,48,.35); border-width: 3px; height: 62px; border-radius: 20px; }
.btn-poster { background: linear-gradient(180deg, #FFFDF7 0%, var(--cream) 100%); box-shadow: var(--hl), var(--lo), 0 7px 0 var(--ink); }
.btn-white { background: linear-gradient(180deg, #fff 0%, #FBF4E6 100%); box-shadow: var(--hl), inset 0 -3px 0 rgba(0,0,0,.06), 0 5px 0 var(--ink); }
.btn-dark { background: linear-gradient(180deg, #2C2048 0%, var(--ink) 100%); box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 6px 0 #07030F; }
.btn-green { background: linear-gradient(180deg, #22B97C 0%, var(--grn) 100%); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn-gold { width: auto; padding: 0 22px; height: 62px; border-width: 3px; border-radius: 18px; background: linear-gradient(180deg, #FFE27A 0%, var(--yel) 60%, #F2B92E 100%); color: var(--ink); font-family: 'Lalezar', sans-serif; font-size: 24px; box-shadow: var(--hl), var(--lo), 0 6px 0 var(--ink); }
.btn-sm { box-shadow: var(--hl), 0 4px 0 var(--ink); }
.btn-ghost { box-shadow: 0 3px 0 var(--ink); }
.btn-ghost:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink) !important; }
.icon-btn { background: linear-gradient(180deg, #fff, var(--cream)); box-shadow: var(--hl), 0 4px 0 var(--ink); }
/* a slow light sweep on the main call to action */
.btn-coral::after, .btn-gold::after, .btn-poster[data-start]::after, .btn-poster[data-again]::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%); transform: translateX(-120%); animation: sweep 3.8s ease-in-out infinite 1.2s; pointer-events: none; }
@keyframes sweep { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn:disabled::after { display: none; }
/* ink ripple from the finger */
.rip { position: absolute; border-radius: 50%; background: currentColor; opacity: .18; transform: scale(0); animation: rip .55s ease-out forwards; pointer-events: none; z-index: 2; }
@keyframes rip { to { transform: scale(1); opacity: 0; } }
.seg button, .opt, .avopt, .gpick, .reacts button { position: relative; overflow: hidden; }

/* ---------- cards ---------- */
.card { box-shadow: 0 6px 0 var(--ink); border-width: 3px; border-radius: 22px; }
.card-poster { box-shadow: 0 8px 0 var(--ink); background: linear-gradient(180deg, #FFFDF7, var(--cream)); }
.prompt { position: relative; background: linear-gradient(160deg, #FF7D57 0%, var(--coral) 45%, #EE4628 100%); border-width: 3px; box-shadow: var(--hl), 0 8px 0 var(--ink); color: var(--cream); text-shadow: 0 2px 0 rgba(27,18,48,.35); }
.prompt .blank { border-color: var(--yel); }
.ans { border-width: 3px; box-shadow: 0 6px 0 var(--ink); transition: transform .14s var(--e-spring), box-shadow .14s, background .2s; }
button.ans:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); }
.ans.pick { background: linear-gradient(180deg, #FFE27A, var(--yel)); animation: pickpop .35s var(--e-spring); }
@keyframes pickpop { 40% { transform: scale(1.03) rotate(-.6deg); } }
.ans.win { background: linear-gradient(180deg, #FFE27A, var(--yel)); box-shadow: 0 0 0 4px var(--cream), 0 0 0 7px var(--ink), 0 12px 0 4px var(--ink); animation: winpop .6s var(--e-spring) both; }
@keyframes winpop { 0% { transform: scale(.9); } 60% { transform: scale(1.04) rotate(-1deg); } }
.ans .pts { color: var(--coral); text-shadow: 0 2px 0 var(--ink); -webkit-text-stroke: 1px var(--ink); }

/* ---------- avatars ---------- */
.av { display: inline-flex; flex: none; width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.35), transparent 55%), var(--av); border: 2.5px solid var(--ink); overflow: hidden; vertical-align: middle; }
.av svg { width: 100%; height: 100%; display: block; transform: scale(.92); }
.pdot { color: inherit; font-size: 0; }
.av.pdot.lg { width: 46px; height: 46px; }
.av.pdot.lg2 { width: 62px; height: 62px; border-width: 3px; box-shadow: 0 4px 0 var(--ink); }
.av.pdot.xl { width: 112px; height: 112px; border-width: 4px; box-shadow: 0 6px 0 var(--ink); }
.av.speaking { animation: speak 1.6s ease-in-out infinite; }
@keyframes speak { 50% { box-shadow: 0 6px 0 var(--ink), 0 0 0 10px rgba(255,90,60,.25); } }
.avpick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.avopt { appearance: none; border: 0; background: none; padding: 4px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; transition: transform .15s var(--e-spring); }
.avopt .av { width: 58px; height: 58px; border-width: 3px; box-shadow: 0 4px 0 var(--ink); transition: transform .15s var(--e-spring); }
.avopt:active .av { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.avopt.on .av { box-shadow: 0 0 0 3px var(--cream), 0 0 0 6px var(--ink), 0 7px 0 3px var(--ink); transform: translateY(-3px) scale(1.06); }
.avopt.on { animation: pickpop .35s var(--e-spring); }

/* ---------- home ---------- */
.home-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 10px; }
.home-hero .logo.xl { font-size: 96px; animation: logoin .8s var(--e-spring) both; }
@keyframes logoin { from { transform: rotate(-5deg) scale(.6); opacity: 0; } }
.hh-sub { color: var(--cream); font-weight: 700; font-size: 16px; text-shadow: 0 1px 0 rgba(27,18,48,.25); margin-top: 4px; }
.hh-art { width: 100%; max-width: 420px; height: auto; margin: 4px 0 -4px; filter: drop-shadow(0 10px 18px rgba(27,18,48,.18)); animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-6px); } }
.hh-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.hh-pills span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; background: rgba(27,18,48,.82); color: var(--cream); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.sec-h { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.sec-h .lz { font-size: 28px; color: var(--cream); text-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.sec-line { flex: 1; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, rgba(255,244,224,.7)); }
/* poster cards */
.gposter { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: linear-gradient(180deg, #FFFDF7, var(--cream)); border: 3px solid var(--ink); border-radius: 26px; overflow: hidden; box-shadow: 0 8px 0 var(--ink); transition: transform .16s var(--e-spring), box-shadow .16s; animation: rise .6s var(--e-out) both; animation-delay: calc(var(--i, 0) * 90ms + 150ms); }
.gposter:active { transform: translateY(6px) scale(.99); box-shadow: 0 2px 0 var(--ink); transition-duration: .05s; }
.gp-art { position: relative; display: block; aspect-ratio: 400 / 220; background: var(--tone); border-bottom: 3px solid var(--ink); overflow: hidden; }
.gp-img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--e-out); }
.gposter:hover .gp-img { transform: scale(1.04); }
.gp-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.gp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gp-body .gc-s { font-size: 15px; font-weight: 600; color: #4B3F5C; }
.gp-body .wm { color: var(--tone); }
.gp-cta { display: inline-flex; align-items: center; gap: 4px; background: var(--tone); color: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 6px 14px; font-family: 'Lalezar', sans-serif; font-size: 20px; line-height: 1.2; box-shadow: var(--hl), 0 4px 0 var(--ink); text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.gp-cta svg { transform: scaleX(-1); }
.gposter.soon .gp-img { filter: saturate(.55) brightness(.92); }
.gposter.soon .gp-cta { background: var(--ink); }
.gp-ribbon { position: absolute; top: 18px; left: -36px; transform: rotate(-35deg); background: var(--yel); border-block: 3px solid var(--ink); padding: 3px 44px; font-family: 'Lalezar', sans-serif; font-size: 18px; box-shadow: 0 3px 0 rgba(27,18,48,.4); }
.glist { gap: 20px; }
/* quick join */
.joincard { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(170deg, #2C2048, var(--ink)); color: var(--cream); border: 3px solid var(--ink); border-radius: 24px; padding: 16px; box-shadow: 0 8px 0 #07030F; }
.jc-t { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.jc-t .lz { font-size: 26px; }
.jc-t .small { font-weight: 600; opacity: .8; }
.jc-row { display: flex; gap: 10px; }
.jc-row .code-input { flex: 1; min-width: 0; height: 62px; font-size: 34px; letter-spacing: 8px; background: var(--cream); color: var(--ink); border-width: 3px; }
.howto { display: grid; gap: 10px; }
.howto div { display: flex; align-items: center; gap: 12px; background: rgba(255,244,224,.14); border: 2px solid rgba(27,18,48,.35); border-radius: 16px; padding: 10px 12px; color: var(--cream); font-weight: 700; font-size: 14px; }
.howto b { width: 30px; height: 30px; flex: none; border-radius: 10px; background: var(--yel); color: var(--ink); border: 2.5px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: 'Lalezar', sans-serif; font-size: 18px; box-shadow: 0 2px 0 var(--ink); }
.foot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 4px; color: var(--cream); font-size: 12px; font-weight: 600; opacity: .9; }

/* ---------- game page hero with art ---------- */
.ghero.big { padding: 0 0 18px; overflow: hidden; gap: 6px; background: linear-gradient(180deg, var(--tone), var(--deep)); box-shadow: 0 8px 0 var(--ink); }
.gh-art { display: block; width: 100%; aspect-ratio: 400 / 220; border-bottom: 3px solid var(--ink); margin-bottom: -26px; }
.gh-art .gp-img { width: 100%; height: 100%; }
.ghero.big .wm { position: relative; z-index: 1; filter: drop-shadow(0 4px 0 rgba(27,18,48,.25)); }
.ghero.big > span { padding-inline: 14px; }
.ghero.sm { box-shadow: 0 7px 0 var(--ink); background-image: var(--pat), linear-gradient(160deg, var(--tone), var(--deep)); }
.stepn { box-shadow: 0 2px 0 var(--ink); }

/* ---------- lobby ---------- */
.codecard { background: linear-gradient(160deg, #FF7D57 0%, var(--coral) 50%, #E8431F 100%); border-width: 3px; box-shadow: var(--hl), 0 8px 0 var(--ink); position: relative; overflow: hidden; }
.codecard::before { content: ''; position: absolute; inset: 0; background: url(/games/qolha-pat.svg); opacity: .5; pointer-events: none; }
.codecard > * { position: relative; }
.roomcode { text-shadow: 0 5px 0 var(--ink); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; letter-spacing: 12px; }
.players { gap: 10px; }
.pl { border-width: 3px; box-shadow: 0 4px 0 var(--ink); padding: 8px 10px; animation: rise .4s var(--e-spring) both; animation-delay: calc(var(--i, 0) * 50ms); }
.pl-t { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.pl .nm { font-size: 15px; }
.pl-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; line-height: 1.5; border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 7px; background: var(--cream); white-space: nowrap; }
.tag.host { background: var(--yel); }
.tag.me { background: var(--ink); color: var(--cream); }

/* ---------- timer ring ---------- */
.timer { position: relative; gap: 0; min-width: 0; width: 56px; height: 56px; padding: 0; border-radius: 50%; border-width: 3px; box-shadow: 0 4px 0 var(--ink); background: var(--cream); font-family: 'Lalezar', sans-serif; font-weight: 400; font-size: 24px; overflow: hidden; }
.timer .tring { position: absolute; inset: 4px; border-radius: 50%; background: conic-gradient(var(--grn) calc(var(--p, 1) * 360deg), transparent 0); -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%); transition: background .3s; }
.timer b { position: relative; font-weight: 400; line-height: 1; margin-top: 4px; }
.timer.low { background: #FFE3DC; color: var(--ink); }
.timer.low .tring { background: conic-gradient(var(--coral) calc(var(--p, 1) * 360deg), transparent 0); }
.timer.tick { animation: tick .4s var(--e-spring); }
@keyframes tick { 40% { transform: scale(1.18); } }
body.night .timer { background: #17112A; border-color: #3A2F55; }

/* ---------- results ---------- */
.res-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding-top: 4px; }
.res-title { font-size: 44px; line-height: 1.1; color: var(--cream); text-shadow: 0 4px 0 var(--ink); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.res-badge { font-size: 20px !important; font-weight: 400; padding: 2px 16px; transform: rotate(-3deg); border-width: 2.5px; box-shadow: 0 3px 0 var(--ink); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin-top: 6px; }
.pod { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 6px; animation: rise .7s var(--e-spring) both; }
.pod.p1 { animation-delay: .5s; } .pod.p2 { animation-delay: .3s; } .pod.p3 { animation-delay: .15s; }
.pod-crown { animation: crown 2.4s ease-in-out infinite; filter: drop-shadow(0 3px 0 var(--ink)); margin-bottom: -8px; z-index: 1; }
@keyframes crown { 50% { transform: translateY(-5px) rotate(-6deg); } }
.pod-n { color: var(--cream); font-size: 15px; text-shadow: 0 2px 0 var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-b { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6px; border: 3px solid var(--ink); border-bottom: 0; border-radius: 16px 16px 0 0; background: linear-gradient(180deg, #FFFDF7, #F3E3C4); box-shadow: inset 0 3px 0 #fff; }
.pod-b .lz { font-size: 34px; line-height: 1; }
.pod-s { font-weight: 800; font-size: 14px; }
.pod.p1 .pod-b { height: 120px; background: linear-gradient(180deg, #FFE27A, #F2B92E); }
.pod.p2 .pod-b { height: 88px; } .pod.p3 .pod-b { height: 66px; }
.podium + .rank, .podium ~ .reacts { margin-top: 0; }
.podium { border-bottom: 4px solid var(--ink); padding-bottom: 0; }
.rk { border-width: 3px; box-shadow: 0 4px 0 var(--ink); }
.cf { position: absolute; top: -20px; border: 1.5px solid rgba(27,18,48,.6); border-radius: 2px; animation: cf 3s cubic-bezier(.3, .4, .5, 1) forwards; }
@keyframes cf { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }

/* ---------- wolves ---------- */
.roleart { display: inline-flex; flex: none; border-radius: 26%; background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.3), transparent 60%), var(--rb); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); overflow: hidden; }
.roleart svg { width: 100%; height: 100%; }
.rk .roleart { border-width: 2px; box-shadow: none; border-radius: 10px; }
.rolecard { min-height: 300px; box-shadow: 0 8px 0 var(--ink); }
.rolecard .cover { padding: 0; }
.rc-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.rc-hold { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; background: rgba(18,12,51,.78); border: 2px solid #4A3D6B; border-radius: 20px; padding: 14px 18px; margin: 18px; backdrop-filter: blur(2px); }
.rc-ring { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--yel); position: relative; }
.rc-ring::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--yel); animation: hold 1.4s ease-in-out infinite; }
@keyframes hold { 50% { transform: scale(.55); opacity: .6; } }
.rolecard .face { transform: scale(.96); transition: opacity .18s, transform .25s var(--e-spring); }
.rolecard.show .face { transform: none; }
.ncard { border-radius: 22px; background: linear-gradient(180deg, #1D1535, #140E27); box-shadow: 0 0 0 1px rgba(255,255,255,.03), 0 18px 40px rgba(0,0,0,.35); }
.opt { border-width: 3px; box-shadow: 0 4px 0 var(--ink); transition: transform .12s var(--e-spring), box-shadow .12s; }
.opt:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.opt.on { background: linear-gradient(180deg, #FFE27A, var(--yel)); animation: pickpop .3s var(--e-spring); }
.wp { border-width: 2.5px; box-shadow: 0 3px 0 var(--ink); }

/* ---------- inputs, chips, sheets ---------- */
.input { border-width: 3px; box-shadow: inset 0 3px 0 rgba(27,18,48,.06); transition: box-shadow .15s, transform .15s; }
.input:focus { box-shadow: inset 0 3px 0 rgba(27,18,48,.06), 0 0 0 4px var(--yel); }
.seg { border-width: 3px; box-shadow: 0 4px 0 var(--ink); }
.seg button { transition: background .2s, color .2s; }
.seg button.on { background: linear-gradient(180deg, #2C2048, var(--ink)); }
.chip { box-shadow: 0 2px 0 var(--ink); }
.mchip { box-shadow: 0 2px 0 var(--ink); }
.modal { backdrop-filter: blur(3px); animation: fade .2s ease; }
.sheet { animation: sheetin .35s var(--e-out); box-shadow: 0 -10px 30px rgba(0,0,0,.18); }
@keyframes sheetin { from { transform: translateY(40%); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
#toast { border-radius: 18px; box-shadow: 0 6px 0 #07030F, 0 14px 30px rgba(0,0,0,.25); transform: translateY(calc(100% + 40px)); visibility: hidden; transition: transform .35s var(--e-spring), visibility 0s .35s; }
#toast.on { visibility: visible; transition: transform .35s var(--e-spring), visibility 0s; }
.reacts button { box-shadow: var(--hl), 0 4px 0 var(--ink); border-width: 3px; }
.bar { height: 14px; border-width: 2.5px; box-shadow: 0 2px 0 var(--ink); }
.bar > i { background: repeating-linear-gradient(-45deg, var(--grn) 0 10px, #22B97C 10px 20px); background-size: 28px 28px; animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 28px 0; } }

/* ---------- screen entrance ---------- */
@keyframes rise { from { transform: translateY(18px) scale(.98); opacity: 0; } }
#app.enter > * { animation: rise .5s var(--e-out) both; }
/* a new step of the same game: only what changed comes in */
#app.step > :not(:first-child):not(.kplay):not(.kscore):not(.wfoot):not(.wtv):not(.banner), #app.step .kcol.side > *, #app.step .wtv-main > *, #app.step .wtv-clock { animation: stepin .32s var(--e-out) both; }
@keyframes stepin { from { transform: translateY(10px); opacity: 0; } }
#app.enter > *:nth-child(2) { animation-delay: .05s; } #app.enter > *:nth-child(3) { animation-delay: .1s; } #app.enter > *:nth-child(4) { animation-delay: .15s; } #app.enter > *:nth-child(5) { animation-delay: .2s; } #app.enter > *:nth-child(n+6) { animation-delay: .25s; }
#app.enter .prompt { animation: promptin .55s var(--e-spring) both .05s; }
@keyframes promptin { from { transform: scale(.85) rotate(-2deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .glist { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glist .gposter { flex-direction: column; }
  .gposter:hover { transform: translateY(-4px); box-shadow: 0 12px 0 var(--ink); }
  .home-hero { display: grid; grid-template-columns: 1fr 1fr; align-items: center; text-align: right; gap: 0 30px; }
  .home-hero .logo.xl { font-size: 140px; justify-self: start; }
  .home-hero .hh-sub { font-size: 20px; grid-column: 1; }
  .home-hero .hh-art { grid-column: 2; grid-row: 1 / span 3; max-width: 520px; }
  .home-hero .hh-pills { justify-content: flex-start; grid-column: 1; }
  body[data-screen=home] .joincard { max-width: 560px; align-self: center; width: 100%; }
  .howto { grid-template-columns: repeat(3, 1fr); }
  .sec-h .lz { font-size: 34px; }
  .cols.gpage .ghero.big { padding: 0 0 26px; }
}

/* ---------- خريطة القعدة ---------- */
.kboard { background: linear-gradient(180deg, #BFE4EE, #A9D8E6); border: 3px solid var(--ink); border-radius: 22px; box-shadow: var(--hl), 0 7px 0 var(--ink); padding: 6px; position: relative; overflow: hidden; }
.kboard::before { content: ''; position: absolute; inset: 0; background: url(/games/kharita-pat.svg); opacity: .35; pointer-events: none; }
.kboard svg { display: block; width: 100%; height: auto; max-height: 62vh; position: relative; direction: ltr; border-radius: 14px; }
.kt { stroke: var(--ink); stroke-width: 1.6px; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: fill .5s; }
.kt.own { stroke-width: 2px; }
.kt.can { cursor: pointer; stroke: var(--yel); stroke-width: 3.6px; paint-order: fill; animation: kpulse 1.1s ease-in-out infinite; filter: brightness(1.06); }
@keyframes kpulse { 50% { stroke: #fff; stroke-width: 5px; } }
.kt.tgt { stroke: var(--yel); stroke-width: 5px; }
.kt.took { animation: ktook 1s ease-out; }
@keyframes ktook { 0%, 40% { fill: #fff; } 20% { fill: var(--yel); } }
.kl { pointer-events: none; }
.kl text { font-family: 'Readex Pro', sans-serif; font-weight: 700; text-anchor: middle; fill: var(--ink); paint-order: stroke; stroke: rgba(255,255,255,.75); stroke-linejoin: round; }
.kl.own text { fill: #fff; stroke: rgba(27,18,48,.6); }
.kl .crown { fill: var(--yel); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.kl .sg { fill: var(--yel); stroke: var(--ink); stroke-width: 1.5; }
.kl .sgt { font: 800 9px 'Readex Pro', sans-serif; text-anchor: middle; fill: var(--ink); stroke: none; }
.kzoom { position: absolute; z-index: 2; bottom: 12px; left: 12px; display: flex; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; box-shadow: 0 3px 0 var(--ink); }
.kzoom button { all: unset; cursor: pointer; font: 700 12px 'Readex Pro', sans-serif; padding: 5px 11px; color: var(--ink); }
.kzoom button.on { background: var(--ink); color: #fff; }
.kcredit { position: absolute; bottom: 7px; inset-inline-end: 12px; font-size: 9px; font-weight: 600; color: var(--ink); opacity: .55; direction: ltr; }
.kchips { display: flex; flex-wrap: wrap; gap: 8px; }
.kchip { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: 700 14px 'Readex Pro', sans-serif; color: var(--ink); background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 7px 12px 7px 10px; box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; -webkit-tap-highlight-color: transparent; }
.kchip:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.kchip b { font-family: 'Lalezar', sans-serif; font-weight: 400; font-size: 15px; line-height: 1; background: var(--yel); border: 2px solid var(--ink); border-radius: 8px; padding: 3px 6px 1px; }
.kchip.atk { background: var(--tc); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.kchip.atk b { color: var(--ink); text-shadow: none; }
.kchip i { font-style: normal; font-size: 11px; background: var(--ink); color: #fff; border-radius: 999px; padding: 0 6px; }
.kt.off { stroke: rgba(27,18,48,.25); stroke-width: 1px; opacity: .55; }
.kt.shut { opacity: .45; stroke-dasharray: 5 4; }
.kl .kfort { fill: #fff; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.kl .ktrap path { fill: var(--yel); stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.kl .ktrap text { font-family: 'Lalezar', sans-serif; fill: var(--ink); stroke: none; }
.khand { display: flex; flex-direction: column; gap: 8px; }
.kcd { appearance: none; display: flex; align-items: center; gap: 10px; text-align: right; font-family: 'Readex Pro', sans-serif; color: var(--ink); background: linear-gradient(180deg, #FFE48A, var(--yel)); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 12px; box-shadow: var(--hl), 0 5px 0 var(--ink); cursor: pointer; transition: transform .08s, box-shadow .08s; -webkit-tap-highlight-color: transparent; }
.kcd:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.kcd:disabled { cursor: default; background: #fff; box-shadow: 0 3px 0 var(--ink); }
.kcd svg { flex: none; background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: 5px; width: 40px; height: 40px; }
.kcd span { display: flex; flex-direction: column; min-width: 0; }
.kcd b { font-family: 'Lalezar', sans-serif; font-weight: 400; font-size: 19px; line-height: 1.15; }
.kcd small { font-size: 12px; font-weight: 600; opacity: .85; }
.kplayed { display: flex; align-items: center; justify-content: center; gap: 8px; background: #fff; border: 2.5px solid var(--ink); border-inline-start: 10px solid var(--tc); border-radius: 14px; padding: 6px 12px; font-weight: 700; font-size: 14px; animation: promptin .5s var(--e-spring); }
.kstage { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; background: var(--ink); color: #fff; border: 3px solid var(--ink); border-radius: 22px; padding: 18px 14px; box-shadow: 0 7px 0 rgba(27,18,48,.35); font-weight: 600; animation: promptin .5s var(--e-spring); }
.kstage .lz { font-size: 44px; line-height: 1.1; color: var(--yel); }
.kstage.ev { background: linear-gradient(180deg, #3B2A7A, #1B1230); }
.kstage.ev svg { color: var(--yel); }
.ksteps { display: flex; gap: 6px; }
.ksteps span { flex: 1; text-align: center; font-weight: 700; font-size: 13px; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; padding: 3px 4px; opacity: .55; }
.ksteps span.on { opacity: 1; background: var(--yel); box-shadow: 0 3px 0 var(--ink); }
.ksteps span.done { opacity: .9; background: #D9F7E7; }
.kch.sel { background: linear-gradient(180deg, #FFE48A, var(--yel)); }
.kch.gone { opacity: .25; border-style: dashed; }
.kch { flex-wrap: wrap; }
.kvotes { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px; font-style: normal; }
.kvotes em { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: var(--tc); border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 7px; text-shadow: none; }
.kprog { display: flex; gap: 8px; justify-content: center; }
.kprog span { font-weight: 700; font-size: 13px; background: #fff; border: 2.5px solid var(--ink); border-inline-start: 9px solid var(--tc); border-radius: 12px; padding: 2px 10px; }
.kduel { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.kduel-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.kduel-p { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; background: var(--tc); color: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 6px 10px; box-shadow: var(--hl), 0 4px 0 var(--ink); font-weight: 700; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.kduel-p b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kduel-p .lz { font-size: 30px; line-height: 1; margin-top: 4px; }
.kduel-p .av { width: 32px; height: 32px; border-width: 2px; flex: none; }
.kvs { font-size: 22px; }
.knew { display: flex; flex-direction: column; gap: 6px; }
.knew span { font-weight: 700; font-size: 14px; text-align: center; background: var(--yel); border: 2.5px solid var(--ink); border-inline-start: 10px solid var(--tc); border-radius: 12px; padding: 4px 10px; }
.kmod { display: inline-flex; align-items: center; gap: 4px; background: var(--yel); }
.kscore { display: flex; align-items: center; gap: 8px; }
.kteam { display: inline-flex; align-items: center; gap: 6px; background: var(--tc); color: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 3px 10px; font-weight: 800; font-size: 14px; box-shadow: var(--hl), 0 3px 0 var(--ink); text-shadow: 0 1px 0 rgba(0,0,0,.3); white-space: nowrap; }
.kteam b { font-family: 'Lalezar', sans-serif; font-weight: 400; font-size: 24px; line-height: 1; margin-top: 3px; }
.kteam i { font-style: normal; font-size: 10px; background: var(--ink); border-radius: 999px; padding: 1px 6px; }
.kbar { flex: 1; height: 14px; display: flex; justify-content: space-between; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.kbar i { display: block; height: 100%; transition: width .6s var(--e-out); }
.klegend { display: flex; flex-wrap: wrap; gap: 6px; }
.klegend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 8px; }
.klegend i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink); }
.kbanner { display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--tc); color: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 8px 12px; box-shadow: var(--hl), 0 5px 0 var(--ink); text-shadow: 0 2px 0 rgba(27,18,48,.3); }
.kbanner .lz { font-size: 26px; line-height: 1.2; }
.kbanner .small { font-weight: 700; }
.kteams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kcard { background: #fff; border: 3px solid var(--ink); border-radius: 18px; overflow: hidden; box-shadow: 0 5px 0 var(--ink); }
.kcard > .lz { display: flex; align-items: center; justify-content: center; gap: 4px; background: var(--tc); color: #fff; font-size: 22px; padding: 2px 8px; border-bottom: 3px solid var(--ink); text-shadow: 0 2px 0 rgba(27,18,48,.3); }
.kcard.win { box-shadow: 0 0 0 3px var(--yel), 0 0 0 6px var(--ink), 0 10px 0 4px var(--ink); }
.kpl { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.kpl span { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; min-width: 0; }
.kpl .av { width: 28px; height: 28px; border-width: 2px; }
.kpl em { margin-inline-start: auto; font-style: normal; font-size: 12px; color: var(--muted); direction: ltr; }
.kq { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 14px; box-shadow: 0 6px 0 var(--ink); border-top: 10px solid var(--cc); }
.kq-t { font-family: 'Lalezar', sans-serif; font-size: 25px; line-height: 1.35; }
.kchs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kch { appearance: none; position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; min-height: 62px; text-align: right; background: linear-gradient(180deg, #fff, #FBF4E6); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; padding: 8px 10px; font-weight: 700; font-size: 15px; line-height: 1.3; box-shadow: var(--hl), 0 5px 0 var(--ink); cursor: pointer; transition: transform .12s var(--e-spring), box-shadow .12s, background .3s; }
.kch b { flex: none; width: 28px; height: 28px; border-radius: 9px; background: var(--yel); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font-family: 'Lalezar', sans-serif; font-weight: 400; font-size: 17px; }
.kch:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }
.kch:disabled { cursor: default; color: var(--ink); opacity: 1; }
.kch.ok { background: linear-gradient(180deg, #3FD08F, var(--grn)); color: #fff; animation: winpop .6s var(--e-spring); }
.kch.bad { background: linear-gradient(180deg, #FF8A6E, #E8392B); color: #fff; animation: shake .4s; }
.kch.dim { opacity: .5; }
@keyframes shake { 25% { transform: translateX(6px); } 50% { transform: translateX(-6px); } 75% { transform: translateX(3px); } }
.kres { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; border: 3px solid var(--ink); border-radius: 18px; padding: 8px 12px; font-weight: 700; box-shadow: 0 5px 0 var(--ink); animation: promptin .5s var(--e-spring); }
.kres .lz { font-size: 30px; line-height: 1.1; }
.kres.ok { background: #D9F7E7; } .kres.bad { background: #FFE0D9; }
.kplay, .kcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.kplay.intro .side { order: -1; }
/* on a phone the map keeps its place from one step to the next: whose turn it is sits above it, cards and hints below */
.kplay.pick .side { display: contents; }
.kplay.pick .kbanner { order: -1; }
.kplay.pick .side > :not(.kbanner) { order: 1; }
@media (min-width: 900px) {
  body[data-screen=play]:has(.kplay) #app { max-width: 1240px; }
  body.tv[data-screen=play]:has(.kplay) #app { max-width: 1500px; zoom: 1; min-height: 100vh; }
  .kplay { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; align-items: center; }
  .kplay.pick .side, .kplay.intro .side { order: 0; display: flex; }
  .kplay.pick .kbanner, .kplay.pick .side > :not(.kbanner) { order: 0; }
  .kq-t { font-size: 34px; } .kch { font-size: 20px; min-height: 78px; } .kchs { gap: 14px; }
  .kbanner .lz { font-size: 40px; } .kbanner .small, .khint { font-size: 18px; }
  .klegend span { font-size: 14px; } .kteam { font-size: 18px; } .kteam b { font-size: 32px; }
  .kres .lz { font-size: 40px; } .kres { font-size: 20px; }
}

/* ---------- «الذئاب» on the TV ---------- */
body.tv[data-screen=play] #app:has(.wtv) { max-width: 1240px; gap: 0; }
.wtv { display: flex; flex-direction: column; gap: 14px; height: calc(94vh / var(--tvz, 1)); }
@media (min-width: 1280px) { body.tv { --tvz: 1.15; } }
@media (min-width: 1600px) { body.tv { --tvz: 1.4; } }
@media (min-width: 1900px) { body.tv { --tvz: 1.6; } }
@media (min-width: 2500px) { body.tv { --tvz: 2.2; } }
.wtv-top { display: flex; align-items: center; gap: 10px; }
.wtv-top .chip { font-size: 18px; padding: 4px 14px; }
.wtv-alive { margin-inline-start: auto; font-weight: 700; font-size: 18px; background: var(--white); border: 2.5px solid var(--ink); border-radius: 999px; padding: 3px 14px; box-shadow: 0 3px 0 var(--ink); }
.wtv.n .wtv-alive { background: #17112A; border-color: #3A2F55; color: #CFC6E2; box-shadow: none; }
.wtv-stage { flex: 1; display: flex; align-items: stretch; gap: 18px; min-height: 0; }
.wtv-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 0; background: linear-gradient(180deg, #FFFDF7, var(--cream)); border: 4px solid var(--ink); border-radius: 32px; padding: 16px 30px; box-shadow: var(--hl), 0 10px 0 var(--ink); position: relative; overflow: hidden; }
.wtv.n .wtv-main { background: radial-gradient(120% 90% at 50% 0%, #2A2163, #120C33 70%); border-color: #3A2F55; color: #F1ECFA; box-shadow: 0 10px 0 #0A0620; }
.wtv-k { font-weight: 700; font-size: 20px; background: var(--yel); border: 2.5px solid var(--ink); border-radius: 999px; padding: 2px 16px; color: var(--ink); }
.wtv-t { font-size: 60px; line-height: 1.15; }
.wtv-main:has(.wtv-deaths) .wtv-t { font-size: 46px; }
.wtv-main:has(.wtv-deaths) .wtv-s { font-size: 20px; }
.wtv-s { font-weight: 600; font-size: 24px; line-height: 1.6; max-width: 30em; opacity: .9; }
.wtv-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .16; pointer-events: none; }
.wtv-moon { width: 130px; height: 130px; filter: drop-shadow(0 0 34px rgba(255,211,77,.55)); animation: floaty 6s ease-in-out infinite; }
.wtv-ic { display: inline-flex; animation: crown 2.4s ease-in-out infinite; }
.wtv-main .av.xl, .wtv-main .pdot.xl { width: 120px; height: 120px; font-size: 58px; }
.wtv-clock { flex: none; width: 200px; display: flex; align-items: center; justify-content: center; background: var(--white); border: 4px solid var(--ink); border-radius: 32px; box-shadow: var(--hl), 0 10px 0 var(--ink); }
.wtv-clock .timer { zoom: 2.6; margin: 0; }
.wtv-prog { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 6px; font-weight: 700; font-size: 18px; }
.wtv-pips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.wtv-pips i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--ink); background: var(--white); transition: background .25s, transform .25s var(--e-spring); }
.wtv-pips i.on { background: var(--grn); transform: scale(1.15); }
.wtv-deaths { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.wtv-d { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--white); color: var(--ink); border: 3px solid var(--ink); border-radius: 20px; padding: 8px 18px; box-shadow: 0 5px 0 var(--ink); min-width: 140px; animation: rise .5s var(--e-spring) both; }
.wtv .wtv-d .pdot.xl { width: 62px; height: 62px; font-size: 30px; box-shadow: 0 4px 0 var(--ink); }
.wtv-d b { font-family: 'Lalezar', sans-serif; font-weight: 400; font-size: 24px; line-height: 1.2; }
.wtv-d span { font-weight: 700; font-size: 16px; }
.wtv-d small { font-weight: 600; font-size: 14px; opacity: .75; }
.wtv-votes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; max-width: 52em; }
.wtv-votes span { display: inline-flex; align-items: center; gap: 6px; background: var(--white); border: 2.5px solid var(--ink); border-radius: 999px; padding: 1px 12px; font-weight: 600; font-size: 15px; }
.wtv-votes i { font-style: normal; opacity: .5; }
.wtv-ppl { flex: none; display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)); gap: 8px; }
.wtv-p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--white); border: 3px solid var(--ink); border-radius: 18px; padding: 8px 12px; box-shadow: 0 4px 0 var(--ink); min-width: 0; transition: transform .25s var(--e-spring), box-shadow .25s; }
.wtv-p .pdot, .wtv-p .av { width: 36px; height: 36px; font-size: 18px; flex: none; }
.wtv-p b { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.wtv-p small { flex-basis: 100%; text-align: center; font-weight: 700; font-size: 13px; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 999px; }
.wtv-p.dead { opacity: .45; box-shadow: none; }
.wtv-p.dead b { text-decoration: line-through; }
.wtv-p.on { transform: translateY(-4px); background: var(--yel); box-shadow: 0 8px 0 var(--ink); }
.wtv.n .wtv-p { background: #17112A; border-color: #3A2F55; color: #CFC6E2; box-shadow: none; }
.wtv.n .wtv-p small { background: #241A3D; border-color: #4A3D6B; }
