/* Ibrahim Games — board-game shell (Ludo Blast, Snakes & Ladders, Chess,
   Tic Tac Boom, Domino). Layered over kit.css: the shared screens are built
   by assets/3d/board.js; each page only adds its accents + game-only CSS. */

/* ---------- Title: the two big doors ---------- */
.bg-doors { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.big-btn.alt, .big-btn2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-width: min(360px, 86vw); height: 68px; padding: 0 30px; border-radius: 24px;
  background: linear-gradient(180deg, #38e1ff, #1f8cff); color: #041628;
  font-family: var(--display); font-size: 30px; letter-spacing: 0.03em;
  box-shadow: 0 7px 0 #1257b0, 0 16px 36px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s;
}
.big-btn2:hover { transform: translateY(-3px) scale(1.03); }
.big-btn2:active { transform: translateY(4px); box-shadow: 0 3px 0 #1257b0; }
.bg-small { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- Setup / lobby option groups ---------- */
.opt-group { margin: 12px 0 4px; text-align: left; }
.opt-group > label { display: block; margin: 0 0 6px 4px; font-size: 12px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  flex: 1 1 0; min-width: 84px; min-height: 48px; padding: 7px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.07); border: 3px solid transparent; font-weight: 900; font-size: 15px; line-height: 1.15;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.seg button small { display: block; font-size: 11px; font-weight: 800; color: rgba(255, 255, 255, 0.62); margin-top: 2px; }
.seg button:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.11); }
.seg button.on { border-color: var(--accent); background: rgba(255, 255, 255, 0.14); }
.robots { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.robot {
  position: relative; padding: 10px 8px 9px; border-radius: 18px; background: rgba(255, 255, 255, 0.07);
  border: 3px solid transparent; text-align: center; font-weight: 900; transition: border-color 0.15s, transform 0.12s;
}
.robot:hover { transform: translateY(-2px); }
.robot.on { border-color: var(--accent); background: rgba(255, 255, 255, 0.14); }
.robot .rb-face { display: block; font-size: 38px; line-height: 1.1; }
.robot b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; letter-spacing: 0.02em; }
.robot small { display: block; font-size: 11.5px; font-weight: 800; color: rgba(255, 255, 255, 0.66); line-height: 1.25; }
.robot .rb-trophy { position: absolute; top: 5px; right: 8px; font-size: 18px; }
.avatars { display: flex; gap: 6px; overflow-x: auto; padding: 3px 2px 6px; scrollbar-width: thin; }
.avatars button { flex: none; width: 48px; height: 48px; border-radius: 14px; font-size: 28px; background: rgba(255, 255, 255, 0.07); border: 3px solid transparent; }
.avatars button.on { border-color: var(--accent); background: rgba(255, 255, 255, 0.16); }
.setup-card { width: min(560px, 95vw); }
.setup-card h2 { margin-bottom: 4px; }

/* ---------- Online: make / join ---------- */
.online-card { width: min(470px, 94vw); }
.nick-row { display: flex; gap: 8px; margin: 10px 0 4px; }
.nick-row input, .join-row input {
  flex: 1; min-width: 0; height: 52px; padding: 0 14px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.3); color: #fff; font: 800 18px var(--font); outline: none; -webkit-user-select: text; user-select: text;
}
.nick-row input:focus, .join-row input:focus { border-color: var(--accent); }
.nick-row button { width: 52px; height: 52px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); font-size: 26px; }
.join-row { display: flex; gap: 8px; margin-top: 8px; }
.join-row .chip-btn { flex: none; width: auto; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; color: rgba(255, 255, 255, 0.55); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 2px; background: rgba(255, 255, 255, 0.12); }
.safe-note { margin-top: 12px; font-size: 12.5px; font-weight: 800; color: rgba(255, 255, 255, 0.6); line-height: 1.4; }
.bg-msg { min-height: 20px; margin-top: 8px; font-weight: 900; font-size: 14px; color: #ffb4b4; }
.bg-msg.ok { color: #9cf5b0; }
.lobby-card { width: min(560px, 95vw); }
.lobby-opts { margin-top: 6px; }

/* ---------- In-play HUD: seats (top), status + actions (bottom) ---------- */
#seats {
  position: absolute; top: 12px; left: 0; right: 0; margin: 0 auto; width: max-content;
  display: flex; gap: 8px; justify-content: center; max-width: calc(100vw - 330px); pointer-events: none;
}
.seat.hud-pill {
  position: relative; flex-direction: row; justify-content: flex-start; gap: 8px; min-width: 0; max-width: 190px;
  padding: 5px 12px 5px 6px; border-radius: 999px; border: 2px solid transparent; transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.seat i { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 22px; background: var(--pc); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
.seat span { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.seat b { font-family: var(--font); font-weight: 900; font-size: 14px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat small { font-size: 11.5px; font-weight: 900; letter-spacing: 0.02em; text-transform: none; color: rgba(255, 255, 255, 0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat.turn { border-color: var(--pc); box-shadow: 0 0 18px var(--pc); transform: scale(1.07); }
.seat.turn i { animation: seat-bob 1s ease-in-out infinite; }
.seat.me b::after { content: " (you)"; color: var(--accent); font-size: 11px; }
.seat.away { opacity: 0.6; }
@keyframes seat-bob { 50% { transform: translateY(-3px) rotate(-6deg); } }
.seat .bubble {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 3;
  padding: 6px 12px; border-radius: 14px; background: #fff; color: #1b1f33; font-weight: 900; font-size: 15px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); animation: bubble 2.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.seat .bubble::before { content: ""; position: absolute; top: -7px; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top: 0; border-bottom-color: #fff; }
@keyframes bubble { 0% { opacity: 0; transform: translateX(-50%) scale(0.4); } 12% { opacity: 1; transform: translateX(-50%) scale(1.08); } 20% { transform: translateX(-50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-6px); } }

#status {
  position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: min(640px, 94vw); padding: 9px 20px 10px; border-radius: 18px; background: var(--glass); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14); text-align: center; font-family: var(--display); font-size: clamp(19px, 3vw, 26px); letter-spacing: 0.02em; line-height: 1.15;
  pointer-events: none; transition: background 0.2s;
}
#status:empty { display: none; }
#status.mine { background: color-mix(in srgb, var(--accent) 28%, rgba(10, 14, 30, 0.7)); border-color: var(--accent); animation: bump 0.4s ease-out; }
#status em { font-style: normal; color: var(--accent); }
#actions {
  position: absolute; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: 10px; align-items: flex-end; justify-content: center; pointer-events: auto;
}
#actions:empty { display: none; }
.act-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 64px; height: 64px; padding: 0 24px; border-radius: 22px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #1b1200; font-family: var(--display); font-size: 28px; letter-spacing: 0.03em;
  box-shadow: 0 6px 0 var(--accent-deep), 0 12px 26px rgba(0, 0, 0, 0.4); animation: breathe 1.6s ease-in-out infinite;
}
.act-btn.soft { background: var(--glass); color: #fff; border: 2px solid rgba(255, 255, 255, 0.25); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35); animation: none; font-size: 20px; backdrop-filter: blur(8px); }
.act-btn:disabled { opacity: 0.45; animation: none; }

/* Online emotes (preset only — never free text) */
#emote-toggle { position: fixed; left: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 26; display: none; width: 54px; height: 54px; border-radius: 50%; background: var(--glass); border: 2px solid rgba(255, 255, 255, 0.25); font-size: 26px; backdrop-filter: blur(8px); }
body.online[data-screen="play"] #emote-toggle { display: grid; place-items: center; }
#emote-bar { position: fixed; left: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 27; display: none; flex-wrap: wrap; gap: 6px; width: min(300px, 80vw); padding: 10px; border-radius: 18px; background: rgba(10, 14, 30, 0.88); border: 1px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px); }
#emote-bar.on { display: flex; }
#emote-bar button { height: 44px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.09); font-weight: 900; font-size: 15px; }
#emote-bar button:hover { background: rgba(255, 255, 255, 0.18); }
body:not([data-screen="play"]) #emote-bar { display: none; }

/* Results */
.res-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 10px; }
.res-list .party-res i { font-style: normal; font-size: 22px; }
.res-trophy { font-size: 64px; line-height: 1; margin: 4px 0 2px; animation: logo-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.new-trophy { display: inline-block; margin: 6px 0 2px; padding: 5px 14px; border-radius: 999px; background: linear-gradient(135deg, #ffcc1f, #ff8a1f); color: #1b1200; font-weight: 900; font-size: 14px; letter-spacing: 0.06em; animation: wiggle 0.9s ease-in-out infinite; }

/* Phones */
@media (max-width: 700px) {
  #seats { max-width: calc(100vw - 24px); top: 68px; gap: 5px; }
  .seat.hud-pill { padding: 4px 9px 4px 4px; gap: 6px; max-width: 150px; }
  .seat i { width: 30px; height: 30px; font-size: 18px; }
  .seat b { font-size: 12.5px; }
  .seat small { font-size: 10.5px; }
  .act-btn { height: 58px; font-size: 24px; padding: 0 18px; }
  .act-btn.soft { font-size: 17px; }
  #actions { bottom: calc(68px + env(safe-area-inset-bottom)); }
}
@media (max-width: 440px) {
  #seats { flex-wrap: wrap; row-gap: 5px; }
  .seat.hud-pill { max-width: 124px; }
  .seat.me b::after { content: ""; }
}
/* Landscape phones: seats stay in the top bar between the corner buttons. */
@media (orientation: landscape) and (max-height: 520px) {
  #seats { top: 10px; max-width: calc(100vw - 300px); }
  #status { bottom: 8px; padding: 6px 16px 7px; font-size: 19px; }
  #actions { bottom: 54px; }
  .act-btn { height: 52px; font-size: 22px; }
  .screen .card { padding: 16px 18px; }
  .big-btn.alt, .big-btn2 { height: 56px; font-size: 24px; }
}

/* Title on short landscape phones: smaller logo, doors side by side. */
.title-props { font-size: 40px; letter-spacing: 10px; margin-top: 6px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4)); animation: tp-bob 2.4s ease-in-out infinite; }
@keyframes tp-bob { 50% { transform: translateY(-6px) rotate(-2deg); } }
@media (orientation: landscape) and (max-height: 520px) {
  .screen.title-screen { padding-top: 14px; padding-bottom: 10px; gap: 6px; }
  .title-screen .game-logo { font-size: 44px; }
  .title-screen .tagline { font-size: 15px; margin-top: 4px; }
  .title-screen .title-props { display: none; }
  .title-bottom { gap: 8px; }
  .bg-doors { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px; }
  .bg-doors .big-btn, .bg-doors .big-btn2 { min-width: 0; height: 54px; font-size: 21px; padding: 0 20px; }
  .bg-doors .chip-btn { height: 44px; }
  .best-line { font-size: 13px; }
}
.card .row-btns .chip-btn { width: auto; flex: 1 1 0; justify-content: center; }

/* Phones: status stays on one line so it never runs into the action button. */
@media (max-width: 520px) {
  #status { font-size: 18px; padding: 8px 14px 9px; }
  #actions { bottom: calc(74px + env(safe-area-inset-bottom)); }
}
/* Landscape phones: action buttons stack in the bottom-right corner, off the board. */
@media (orientation: landscape) and (max-height: 520px) {
  #actions { left: auto; right: calc(14px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); transform: none; flex-direction: column; align-items: flex-end; gap: 6px; }
  #status { bottom: calc(8px + env(safe-area-inset-bottom)); max-width: calc(100vw - 330px); }
  #emote-toggle { left: calc(14px + env(safe-area-inset-left)); bottom: calc(10px + env(safe-area-inset-bottom)); }
  #actions .act-btn.soft { height: 46px; min-width: 0; padding: 0 12px; }
}

/* The action buttons always sit above the status line. */
#actions { z-index: 2; }
/* Online on phones: the status line leaves room for the 💬 emote button. */
@media (max-width: 520px) { body.online #status { max-width: calc(100vw - 150px); } }
/* Setup card: the main buttons stay in view while the options scroll (short landscape phones). */
.setup-card > .btns { position: sticky; bottom: -22px; margin: 14px -24px -22px; padding: 12px 24px 16px; background: linear-gradient(180deg, rgba(12, 16, 34, 0), rgba(12, 16, 34, 0.97) 30%); }
@media (orientation: landscape) and (max-height: 520px) {
  .setup-card > .btns { flex-direction: row; margin: 10px -18px -16px; padding: 10px 18px 12px; bottom: -16px; }
  .setup-card > .btns .big-btn { height: 52px; font-size: 24px; }
  .setup-card > .btns .chip-btn { width: auto; flex: none; }
  .robots { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
  .robot .rb-face { font-size: 28px; }
  .robot small { display: none; }
}

/* Phones: "🌐 ONLINE WITH FRIENDS" wrapped to two lines and spilled out of its
   fixed-height button (mobile audit 2026-09-27). Keep it on one line, sized to fit. */
@media (max-width: 520px) {
  .big-btn.alt, .big-btn2 { white-space: nowrap; font-size: clamp(18px, 6vw, 26px); padding: 0 16px; gap: 8px; }
}
@media (max-width: 360px) {
  .bg-doors .big-btn { white-space: nowrap; font-size: 26px; padding: 0 16px; gap: 8px; }
}
