/* Oink! Mahjong — online play screens (js/ui/online.js): Play online, Host a table, the lobby, the busy card
   and the online standings. Stage px (1600x900); shared controls live in base.css, menus in screens.css. */

/* ---- Play online ------------------------------------------------------------------------------ */

.screen-online .profile-chip { right: 28px; }

.online-body {
  left: 170px; top: 168px; width: 1260px; bottom: 34px;
  display: flex; flex-direction: column; gap: 16px;
}

.online-banner, .online-intro, .online-off {
  display: flex; align-items: center; gap: 20px; flex: none;
  border-radius: 28px; box-shadow: var(--shadow-soft);
  animation: card-in .45s var(--ease-pop) both;
}
.online-banner { padding: 12px 18px 12px 12px; background: var(--cream); box-shadow: 0 0 0 4px var(--gold), var(--shadow-soft); }
.online-banner .pig-portrait { box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px var(--gold); }
.online-banner-text { flex: 1; min-width: 0; }
.online-banner-text strong { display: block; font: 600 30px/1.1 var(--font-display); color: var(--choc); }
.online-banner-text p { margin: 4px 0 0; font: 700 18px/1.3 var(--font-body); color: var(--choc-soft); }

.online-intro { padding: 12px 16px 12px 24px; background: var(--jade-light); color: var(--jade-deep); }
.online-intro p { flex: 1; margin: 0; font: 800 22px/1.3 var(--font-body); }
.online-intro-ico svg { display: block; width: 44px; height: 44px; }

.online-off { padding: 16px 22px 16px 16px; background: var(--cream); }
.online-off-text { flex: 1; }
.online-off-text h2 { margin: 0; font: 600 32px/1.1 var(--font-display); color: var(--coral-dark); }
.online-off-text p { margin: 6px 0 0; font: 700 18px/1.35 var(--font-body); color: var(--choc-soft); }

.online-cards { display: flex; gap: 40px; height: 440px; margin-top: auto; flex: none; }
.online-card {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  padding: 32px 40px 28px;
  animation: card-in .5s var(--ease-pop) both;
}
.online-card.is-join { animation-delay: .08s; }
.online-card-pig { position: absolute; right: 70px; top: 0; width: 0; height: 0; }
.online-card-anchor { position: absolute; left: 0; top: 150px; width: 0; height: 0; animation: pig-breathe 3.2s ease-in-out infinite; }
.online-card-title { margin: 0; padding-right: 150px; font: 700 44px/1.1 var(--font-display); color: var(--jade-dark); }
.online-card-text { margin: 10px 0 0; padding-right: 150px; font: 700 20px/1.35 var(--font-body); color: var(--choc-soft); }
.online-steps { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 8px; }
.online-steps li { display: flex; align-items: center; gap: 12px; font: 800 19px/1.2 var(--font-body); color: var(--choc); counter-increment: step; }
.online-steps li::before {
  content: counter(step); flex: none; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; background: var(--jade-light); color: var(--jade-deep);
  font: 700 19px/1 var(--font-display);
}
.online-card-foot { margin-top: auto; display: flex; align-items: center; }
.online-card.is-host .online-card-foot .btn { min-width: 260px; }

.code-join { margin-top: 26px; }
.code-row { display: flex; gap: 16px; align-items: center; }
.code-input { height: 84px; border-radius: 24px; font: 600 40px/1 var(--font-display); letter-spacing: 2px; text-transform: uppercase; }
.code-input::placeholder { color: #cdb89c; letter-spacing: 2px; }
.code-row .btn { flex: none; min-width: 170px; }
.code-note { margin: 12px 0 0 8px; font: 700 17px/1.35 var(--font-body); color: var(--choc-soft); }
.code-note.is-bad { color: var(--coral-dark); font-weight: 800; }
.code-input.is-bad { border-color: var(--coral); box-shadow: 0 0 0 4px var(--coral-light); animation: code-shake .4s ease-in-out; }
@keyframes code-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---- the busy card ("Knocking on table PIG-7KQ4M…") ------------------------------------------ */

.busy-panel { width: 600px; padding: 136px 44px 34px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.busy-panel .panel-title { font-size: 36px; }
.busy-pig { position: absolute; left: 50%; top: 0; width: 0; height: 0; }
.busy-pig-anchor { position: absolute; left: 0; top: 124px; width: 0; height: 0; animation: pig-breathe 2.4s ease-in-out infinite; }
.busy-dots { display: flex; gap: 10px; margin: 0 0 6px; }
.busy-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--jade); animation: busy-dot 1.1s ease-in-out infinite; }
.busy-dots i:nth-child(2) { animation-delay: .15s; }
.busy-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes busy-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-10px); opacity: 1; } }

/* ---- Host a table ------------------------------------------------------------------------------ */

.setup-panel.online-setup-panel { width: 1060px; }
.online-setup-panel .panel-head { padding-bottom: 6px; }
.online-setup-panel .opt-row { padding: 10px 0; }
.online-setup-panel .seg span { min-width: 100px; min-height: 46px; font-size: 19px; }

.venue-pick { display: flex; gap: 16px; padding: 8px 0 14px; border-bottom: 2px dashed var(--cream-3); }
.venue-choice { flex: 1; cursor: pointer; }
.venue-body {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 20px;
  background: var(--cream-2); box-shadow: 0 0 0 3px var(--cream-3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.venue-choice:hover .venue-body { transform: translateY(-2px); }
.venue-thumb { height: 78px; background-size: cover; background-position: center; }
.venue-meadow .venue-thumb { background-position: 100% 0%; }
.venue-palace .venue-thumb { background-position: 0% 0%; }
.venue-name { padding: 8px 14px 0; font: 600 21px/1.1 var(--font-display); color: var(--choc); }
.venue-bots { padding: 2px 14px 10px; font: 800 14px/1.2 var(--font-body); color: var(--choc-soft); }
.venue-choice input:checked + .venue-body {
  background: var(--jade-light);
  box-shadow: 0 0 0 5px var(--jade), 0 8px 18px rgba(21, 92, 60, .3);
  transform: translateY(-3px);
}
.venue-choice input:focus-visible + .venue-body { outline: 4px solid var(--gold); outline-offset: 5px; }

/* ---- the lobby ------------------------------------------------------------------------------------ */

.screen-lobby .screen-head { top: 24px; }
.screen-lobby .screen-heading { font-size: 56px; }
.lobby-bg {
  z-index: 0; left: -40px; top: -40px; width: 1680px; height: 980px;
  background: url("../assets/ui/title.jpg") center / cover;
  filter: blur(10px) brightness(.55) saturate(1.1);
}

.lobby-table { left: 30px; top: 150px; width: 740px; height: 740px; --rim-a: #c08a57; --rim-b: #6e4326; --felt-a: #6cbc7b; --felt-b: #3f8f55; --felt-c: #2b6a3d; }
.lobby-table[data-venue="teahouse"] { --rim-a: #8f6443; --rim-b: #3f2518; --felt-a: #4fb39a; --felt-b: #2c7d69; --felt-c: #1c5646; }
.lobby-table[data-venue="palace"] { --rim-a: #f0c35a; --rim-b: #9c6a14; --felt-a: #d9635c; --felt-b: #a83535; --felt-c: #721d22; }

.lobby-felt {
  position: absolute; left: 240px; top: 240px; width: 260px; height: 260px; padding: 14px;
  border-radius: 56px; background: linear-gradient(135deg, var(--rim-a), var(--rim-b));
  box-shadow: 0 16px 30px rgba(24, 10, 4, .5);
}
.lobby-felt-inner {
  position: relative; width: 100%; height: 100%; border-radius: 44px;
  background: radial-gradient(circle, var(--felt-a) 0%, var(--felt-b) 60%, var(--felt-c) 100%);
}
.lobby-wind { position: absolute; font-size: 38px; line-height: 1; color: rgba(255, 248, 236, .82); }
.wind-r0 { left: 50%; bottom: 10px; transform: translateX(-50%); }
.wind-r1 { right: 12px; top: 50%; transform: translateY(-50%); }
.wind-r2 { left: 50%; top: 10px; transform: translateX(-50%); }
.wind-r3 { left: 12px; top: 50%; transform: translateY(-50%); }
.lobby-coin {
  position: absolute; left: 50%; top: 50%; width: 86px; height: 86px; margin: -43px 0 0 -43px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: linear-gradient(var(--rim-a), var(--rim-b)); border: 3px solid rgba(255, 248, 236, .35);
}
.lobby-coin svg { width: 44px; height: 44px; }

.lobby-chair {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center; color: var(--cream);
}
.chair-r0 { left: 220px; top: 510px; width: 300px; }
.chair-r2 { left: 220px; top: 20px; width: 300px; }
.chair-r1 { left: 506px; top: 308px; width: 234px; }
.chair-r3 { left: 0; top: 308px; width: 234px; }
.chair-face { position: relative; display: flex; align-items: center; justify-content: center; width: 132px; height: 124px; }
.lobby-chair .pig-portrait { box-shadow: inset 0 0 0 4px #fff, 0 0 0 5px var(--cream-edge), 0 8px 18px rgba(0, 0, 0, .35); }
.lobby-chair.is-mine .pig-portrait { box-shadow: inset 0 0 0 4px #fff, 0 0 0 6px var(--jade), 0 8px 18px rgba(0, 0, 0, .35); }
.lobby-chair.is-gone .pig-portrait { filter: grayscale(.7) opacity(.7); }
.chair-crown { position: absolute; left: -6px; top: -24px; width: 62px; height: 48px; transform: rotate(-20deg); z-index: 1; }
.chair-crown svg { display: block; width: 100%; height: 100%; }
.chair-badge {
  position: absolute; right: 4px; bottom: 0; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--jade); color: #fff; font: 700 26px/1 var(--font-display);
  box-shadow: 0 0 0 4px #fff, 0 4px 10px rgba(0, 0, 0, .3);
  animation: badge-pop .35s var(--ease-pop) both;
}
.chair-kick {
  position: absolute; right: -14px; top: -10px; width: 60px; height: 60px; padding: 14px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--coral); color: #fff;
  box-shadow: 0 0 0 4px #fff, 0 4px 12px rgba(0, 0, 0, .35);
  transition: transform .12s ease;
}
.chair-kick:hover { transform: scale(1.08); }
.chair-kick svg { display: block; width: 100%; height: 100%; }
.chair-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 600 30px/1.15 var(--font-display); text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
}
.chair-status { font: 800 20px/1.2 var(--font-body); color: #e6d3c2; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
.chair-status.is-ready { color: #a6f0c6; }
.chair-status.is-host { color: var(--gold-light); }

.lobby-chair.is-open { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; border-radius: 24px; }
.chair-empty {
  width: 118px; height: 118px; border-radius: 50%;
  border: 5px dashed rgba(255, 248, 236, .8); background: rgba(255, 248, 236, .14);
  transition: transform .15s ease, background .15s ease;
}
.chair-empty .pig-portrait { opacity: .6; box-shadow: none; }
.lobby-chair.is-open:hover .chair-empty { transform: scale(1.05); background: rgba(255, 248, 236, .3); }
.lobby-chair.is-open:focus-visible { outline: 4px solid var(--gold); outline-offset: 4px; }
.chair-name.chair-bot { white-space: normal; font: 800 20px/1.2 var(--font-body); color: rgba(255, 248, 236, .95); }
.chair-status.chair-sit { color: var(--gold-light); text-decoration: underline; }

.lobby-side {
  left: 800px; top: 150px; width: 770px; height: 726px; padding: 22px 28px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.lobby-label { font: 900 15px/1 var(--font-body); letter-spacing: 1.6px; text-transform: uppercase; color: var(--choc-soft); }
.lobby-label.is-gold { color: var(--gold-dark); }

.lobby-code {
  display: flex; align-items: center; gap: 22px; padding: 14px 20px 16px 24px; border-radius: 26px;
  background: linear-gradient(135deg, #fff1c9, var(--gold-light)); border: 4px solid var(--gold);
}
.lobby-code-main { display: flex; flex-direction: column; gap: 6px; }
.lobby-code-text {
  font: 700 70px/1 var(--font-display); color: var(--choc); letter-spacing: 1px; white-space: nowrap;
  -webkit-user-select: text; user-select: text;
}
.lobby-code-side { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.lobby-code-side .btn { font-size: 21px; min-height: 54px; padding: 8px 22px 10px; }
.lobby-code-side p { margin: 10px 0 0; font: 700 15px/1.3 var(--font-body); color: var(--choc-soft); }

.lobby-guest {
  display: flex; align-items: center; gap: 20px; padding: 14px 22px 14px 14px; border-radius: 26px;
  background: var(--jade-light); color: var(--jade-deep);
}
.lobby-guest .pig-portrait { flex: none; box-shadow: inset 0 0 0 3px #fff, 0 0 0 4px var(--gold); }
.lobby-guest strong { display: block; font: 600 30px/1.1 var(--font-display); }
.lobby-guest p { margin: 4px 0 2px; font: 700 17px/1.3 var(--font-body); }
.lobby-guest small { font: 800 15px/1.2 var(--font-body); opacity: .8; }

.lobby-pigs { display: flex; justify-content: space-between; }
.lobby-pig {
  position: relative; width: 110px; padding: 4px 0; border: 0; border-radius: 18px; background: none;
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font: inherit; color: var(--choc);
}
.lobby-pig .pig-portrait { box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px var(--cream-edge); transition: transform .15s ease; }
.lobby-pig:not(:disabled):hover .pig-portrait { transform: translateY(-3px); }
.lobby-pig.is-chosen .pig-portrait { box-shadow: inset 0 0 0 3px #fff, 0 0 0 5px var(--jade); transform: scale(1.06); }
.lobby-pig.is-taken { cursor: default; }
.lobby-pig.is-taken .pig-portrait { filter: grayscale(.8) opacity(.55); }
.lobby-pig .chair-badge { right: 4px; top: -4px; bottom: auto; width: 34px; height: 34px; font-size: 20px; }
.lobby-pig:focus-visible { outline: 4px solid var(--gold); outline-offset: 2px; }
.lobby-pig-name {
  max-width: 106px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 800 16px/1.1 var(--font-body);
}
.lobby-pig.is-chosen .lobby-pig-name { color: var(--jade-dark); }
.lobby-pig.is-taken .lobby-pig-name { color: var(--choc-soft); opacity: .75; }

.lobby-rules { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.lobby-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.lobby-chips .chip { font-size: 15px; padding: 5px 12px 6px; }
/* the host just changed this rule (a guest's Ready was cleared): a short glow on it and on I'm ready! */
.lobby-chips .chip.is-new { background: var(--gold); color: var(--choc); animation: rule-new 1.2s ease-in-out 2; }
.lobby-ready.is-nudge { animation: rule-new 1.2s ease-in-out 2; }
@keyframes rule-new { 0%, 100% { transform: none; } 30% { transform: scale(1.08); } 60% { transform: scale(.98); } }
.lobby-change { flex: none; }

.lobby-tip { margin: auto 0 0; display: flex; align-items: center; gap: 10px; font: 700 17px/1.3 var(--font-body); color: var(--choc-soft); }
.lobby-tip-ico { font-size: 26px; }

.lobby-actions {
  display: flex; align-items: center; gap: 16px; min-height: 104px; padding: 10px 10px 10px 24px;
  border-radius: 28px; background: var(--cream-2);
}
.lobby-status { flex: 1; margin: 0; font: 800 22px/1.3 var(--font-body); color: var(--choc); }
.lobby-start, .lobby-ready.btn-lg { min-width: 260px; }
.lobby-ready:not(.btn-lg) { min-width: 200px; }

.lobby-hello {
  margin: auto; display: flex; flex-direction: column; align-items: center; gap: 14px;
  font: 600 32px/1.1 var(--font-display); color: var(--choc-soft);
}
.lobby-hello p { margin: 0; }

/* ---- online standings ---------------------------------------------------------------------------- */

.summary-buttons.is-guest { align-items: center; justify-content: space-between; }
.summary-wait { flex: 1; margin: 0; font: 800 19px/1.3 var(--font-body); color: var(--choc-soft); text-align: left; }

/* ---- the table menu: my clock keeps running under it ------------------------------------------- */

.menu-clock {
  display: inline-block; margin: -10px 0 18px; padding: 8px 20px 9px; border-radius: 999px;
  background: var(--gold-light); color: var(--choc); font: 800 20px/1.2 var(--font-body);
  box-shadow: inset 0 0 0 2px var(--gold);
}
.menu-clock[hidden] { display: none; }

/* ---- effects: lite (js/ui/perf.js): no blur on the full-screen art */
.fx-lite .lobby-bg { filter: brightness(.55) saturate(1.1); }
