/*
 * Cezalı 101 — css/room.css  (docs/LOBBY_REDESIGN.md §3 c; loaded after css/store.css)
 *
 * The waiting room of a chip table of js/ui/room.js — prefix wt-:
 *   .wt            two columns: .wt-side (the prize card .pz, the code box .wt-code, the note, .wt-start) and
 *                  .wt-room (the table and its seats)
 *   .wt-table      the table: wood rim, brass line (::after), .wt-felt with the status (.wt-t, .wt-s, the
 *                  bot-fill bar .xbar, the countdown number .wt-num)
 *   .wt-seat       a seat at a side of the table (.p-t / .p-l / .p-r / .p-b = me): .wt-av (avatar + level, or
 *                  the dashed "Buraya geç" target of an empty seat) and .wt-nm (name, a small role line);
 *                  .is-us / .is-them = the team rings of an eşli table, .is-me, .is-off (no connection),
 *                  .is-empty (a button while seats may be changed, .is-still otherwise)
 * The room, the top bar with its settings pills (.lb-cfg) and the shared atoms (.coin, .xbar, .gl, .av, .tg,
 * .pz, .lvl) are css/lobby.css and css/salons.css.
 *
 * The prize card and the code box are paper cards on the felt (css/lobby.css .pz / .gl, its --lb-* tokens); the
 * table keeps the game's own wood, brass and felt.
 *
 * Base rules = the 1600 × 900 desktop stage; ".is-phone" = the ~800 × 390 phone stage. Owner rules: touch
 * targets >= 44px on phones; plain shapes. Performance (PERF_PLAN): NO keyframes in this file, transitions
 * only on opacity / transform, no filter and no backdrop-filter (the bot-fill bar is one transform transition
 * set by js/ui/room.js).
 */

.wt { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: var(--gap); height: 100%; min-height: 0; }
.is-phone .wt { grid-template-columns: 206px minmax(0, 1fr); }
/* toasts while the waiting room is on top (the stage carries .wt-open): the corner under the balance — the one
   place that never holds a seat, the code box or Başlat */
.stage.wt-open:not(.is-phone) .toast-layer { left: auto; right: 126px; width: 400px; transform: none; align-items: flex-end; }
.stage.wt-open:not(.is-phone) .toast { padding: 9px 16px 9px 12px; font-size: 15px; }
.stage.is-phone.wt-open .toast-layer.over-modal { left: auto; right: max(14px, calc(var(--sa-r, 0px) + 4px)); width: 200px; transform: none; align-items: flex-end; }

/* --- the left column -------------------------------------------------------------------------------------- */
.wt-side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; min-height: 0; }
/* (a column lower than its content — tall safe areas: the prize list gives way, never the code or Başlat) */
.wt-side .pz { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.wt-side .pz-l li { flex: none; }
.wt-side .pz-l li b { flex: none; padding-left: 6px; }
/* a prize of seven digits ("4.750.000", js/ui/room.js .is-long): a size smaller — the whole number is always on
   the card, never cut by its edge */
.wt-side .pz-l li.is-long b { font-size: 17px; }
.wt-side .pz-l li.is-1.is-long b { font-size: 22px; }
.is-phone .wt-side .pz-l li.is-long b { font-size: 14px; }
.is-phone .wt-side .pz-l li.is-1.is-long b { font-size: 16px; }
.wt-note { padding: 0 4px; font: 700 14px/1.4 var(--font-body); color: var(--lb-on-felt-2); }
.is-phone .wt-note { padding: 0 2px; font-size: 11.5px; line-height: 1.3; }
.is-phone .wt-side.has-code.has-start .wt-note { display: none; } /* (no room beside the code box and Başlat) */
.wt-code { display: flex; flex-direction: column; align-items: stretch; flex: none; gap: 10px; padding: 14px 16px 20px; }
.wt-code-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font: 800 15px/1 var(--font-display); color: var(--lb-ink-2); white-space: nowrap; }
.wt-code-h b { font: 800 38px/1 var(--font-num); letter-spacing: 0.14em; margin-right: -0.14em; color: var(--lb-ink); -webkit-user-select: text; user-select: text; }
.wt-code-b { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wt-code-b.is-one { grid-template-columns: 1fr; }
.wt-code-b .btn { min-width: 0; }
.is-phone .wt-code { gap: 5px; padding: 7px 8px 11px 10px; }
.is-phone .wt-code-h { font-size: 12px; }
.is-phone .wt-code-h b { font-size: 25px; }
.is-phone .wt-code-b { gap: 5px; }
.is-phone .wt-code-b .btn { padding: 0 6px; font-size: 14px; }
.wt-start { flex: none; margin-top: auto; height: 60px; font-size: 24px; }
.wt-start:disabled { -webkit-filter: none; filter: none; opacity: 0.45; }
.is-phone .wt-start { height: 48px; font-size: 19px; }

/* --- the table ---------------------------------------------------------------------------------------------- */
.wt-room { --tw: 290px; --th: 138px; --avs: 84px; position: relative; min-width: 0; min-height: 0; }
.is-phone .wt-room { --tw: 150px; --th: 71px; --avs: 52px; }
.wt-fit, .wt-seats { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.wt-fit { transform-origin: 50% 50%; }
.wt-table { position: absolute; left: 50%; top: 50%; width: calc(var(--tw) * 2); height: calc(var(--th) * 2); margin: calc(var(--th) * -1) 0 0 calc(var(--tw) * -1); border-radius: var(--th); background: linear-gradient(180deg, #7b4a26 0%, #5a3218 45%, #3c2010 100%); box-shadow: 0 26px 50px rgba(0, 0, 0, 0.55), 0 8px 18px rgba(0, 0, 0, 0.4), inset 0 2px 1px rgba(255, 225, 170, 0.35), inset 0 -5px 10px rgba(0, 0, 0, 0.55); }
.wt-table::after { content: ''; position: absolute; left: 9px; top: 9px; right: 9px; bottom: 9px; border-radius: inherit; border: 2px solid rgba(233, 190, 102, 0.55); pointer-events: none; }
.wt-felt { position: absolute; left: 15px; top: 15px; right: 15px; bottom: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 30px; border-radius: inherit; background: radial-gradient(90% 85% at 50% 42%, #1b9367 0%, #0f6a48 52%, #0a4a33 100%); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.4), inset 0 12px 26px rgba(0, 0, 0, 0.5), inset 0 -8px 22px rgba(0, 0, 0, 0.3); text-align: center; }
.wt-felt [hidden] { display: none; }
.wt-felt b { font: 800 30px/1.1 var(--font-display); color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); }
.wt-felt span { font: 700 16px/1.25 var(--font-body); color: #d8efe5; }
.wt-felt .xbar { flex: none; width: 200px; height: 7px; margin-top: 4px; background: rgba(0, 0, 0, 0.35); }
.wt-felt .wt-num { font: 800 64px/1 var(--font-num); color: #ffe8a8; }
.wt.is-off .wt-felt b { color: #ffd9a0; }
.is-phone .wt-table::after { left: 5px; top: 5px; right: 5px; bottom: 5px; border-width: 1.5px; }
.is-phone .wt-felt { left: 9px; top: 9px; right: 9px; bottom: 9px; gap: 4px; padding: 0 16px; }
.is-phone .wt-felt b { font-size: 18px; }
.is-phone .wt-felt span { font-size: 12px; }
.is-phone .wt-felt .xbar { width: 120px; height: 5px; margin-top: 2px; }
.is-phone .wt-felt .wt-num { font-size: 40px; }

/* --- the seats ---------------------------------------------------------------------------------------------- */
.wt-seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 150px; margin-left: -75px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: center; }
.wt-seat.p-b { left: 50%; top: calc(50% + var(--th) + 8px); }
.wt-seat.p-t { left: 50%; bottom: calc(50% + var(--th) + 8px); flex-direction: column-reverse; }
.wt-seat.p-l { left: calc(50% - var(--tw) - var(--avs) / 2 - 14px); top: calc(50% - var(--avs) / 2); }
.wt-seat.p-r { left: calc(50% + var(--tw) + var(--avs) / 2 + 14px); top: calc(50% - var(--avs) / 2); }
.wt-av { position: relative; display: block; width: var(--avs); height: var(--avs); flex: none; }
.wt-av .av { width: 100%; height: 100%; box-shadow: 0 0 0 3px var(--gold), 0 6px 12px rgba(0, 0, 0, 0.45); }
.wt-av .lvl { position: absolute; right: -4px; bottom: -2px; }
.wt-seat.is-us .wt-av .av { box-shadow: 0 0 0 3px var(--team-us), 0 6px 12px rgba(0, 0, 0, 0.45); }
.wt-seat.is-them .wt-av .av { box-shadow: 0 0 0 3px var(--team-them), 0 6px 12px rgba(0, 0, 0, 0.45); }
.wt-seat.is-off .wt-av .av { opacity: 0.45; }
.wt-nm { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 17px/1.1 var(--font-display); color: #fff; }
.wt-nm small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 12.5px/1.2 var(--font-body); color: var(--ink-dim); }
/* (beside the table a name ends before the rim: a long one — 14 characters at most — takes a second line,
   it is never cut) */
.wt-seat.p-l .wt-nm, .wt-seat.p-r .wt-nm { max-width: calc(var(--avs) + 40px); overflow: visible; white-space: normal; overflow-wrap: anywhere; }
.wt-seat.is-me .wt-nm { color: #ffe8a8; }
.wt-seat.is-me .wt-nm small { color: var(--ink-dim); }
.wt-seat.is-off .wt-nm small { color: #ffd9a0; }
.wt-seat.is-empty .wt-av { display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.4); background: rgba(0, 0, 0, 0.25); color: rgba(255, 255, 255, 0.7); transition: transform 0.14s var(--ease-out); }
.wt-seat.is-empty .wt-av svg { width: 30%; height: 30%; }
.wt-seat.is-empty .wt-nm { font-size: 14.5px; color: var(--ink-dim); }
.wt-seat.is-empty.is-us .wt-av { border-color: rgba(90, 174, 255, 0.75); }
.wt-seat.is-still .wt-av { border-color: rgba(255, 255, 255, 0.22); }
.wt-seat.is-still .wt-nm { color: var(--ink-mute); }
button.wt-seat { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.wt-seat:hover .wt-av { border-color: rgba(255, 255, 255, 0.7); color: #fff; }
button.wt-seat:active .wt-av { transform: scale(0.94); }
button.wt-seat:disabled { opacity: 0.5; cursor: default; }
button.wt-seat:focus { outline: none; }
button.wt-seat:focus-visible .wt-av { border-color: var(--gold); color: var(--gold); }
.is-phone .wt-seat { gap: 3px; width: 104px; margin-left: -52px; }
/* (above and below the table there is room: the longest name fits on its line) */
.is-phone .wt-seat.p-t, .is-phone .wt-seat.p-b { width: 150px; margin-left: -75px; }
.is-phone .wt-seat.p-b { top: calc(50% + var(--th) + 5px); }
.is-phone .wt-seat.p-t { bottom: calc(50% + var(--th) + 5px); }
.is-phone .wt-seat.p-l { left: calc(50% - var(--tw) - var(--avs) / 2 - 12px); }
.is-phone .wt-seat.p-r { left: calc(50% + var(--tw) + var(--avs) / 2 + 12px); }
.is-phone .wt-av .av { box-shadow: 0 0 0 2px var(--gold), 0 4px 8px rgba(0, 0, 0, 0.45); }
.is-phone .wt-seat.is-us .wt-av .av { box-shadow: 0 0 0 2px var(--team-us), 0 4px 8px rgba(0, 0, 0, 0.45); }
.is-phone .wt-seat.is-them .wt-av .av { box-shadow: 0 0 0 2px var(--team-them), 0 4px 8px rgba(0, 0, 0, 0.45); }
.is-phone .wt-av .lvl { right: -3px; bottom: -2px; }
/* VIP üyelik (docs/VIP.md): a VIP's gold frame over the avatar's ring (a team ring stays under it) and the "VIP"
   badge on its top-left corner (the level is bottom-right) */
.wt-vipframe { position: absolute; left: -6px; top: -6px; right: -6px; bottom: -6px; pointer-events: none; }
.wt-vip { position: absolute; left: -10px; top: -6px; width: 44px; height: 18px; pointer-events: none; }
.wt-vipframe > svg, .wt-vip > svg { display: block; width: 100%; height: 100%; }
.is-phone .wt-vipframe { left: -4px; top: -4px; right: -4px; bottom: -4px; }
.is-phone .wt-vip { left: -8px; top: -5px; width: 34px; height: 14px; }
.is-phone .wt-nm { font-size: 13px; }
.is-phone .wt-nm small { font-size: 10.5px; }
.is-phone .wt-seat.is-empty .wt-nm { font-size: 12px; }
