/* play.lila.moe: the game room on top of base.css (chat.lila.moe's look). */

/* ---------------- shared bits ---------------- */
.game-glyph { display: inline-grid; place-items: center; color: #ffd36b; filter: drop-shadow(0 0 8px rgba(255, 120, 60, .45)); }
.btn--big { min-height: 54px; font-size: 17px; letter-spacing: .04em; }
.btn--big:disabled { filter: none; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--crimson); }
.hero h1.hero-name { font-size: 46px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-size: 14px; }
.copy-row .btn { flex: none; }
.form-msg[data-kind="ok"] { color: #8fe3b0; }

/* ---------------- room layout ---------------- */
/* Wide: the game panel stands left of the chat column. Narrow: one column; the chat's parts become the
   room's own rows (display: contents), so the game bar sits between the header and the messages. */
.room { position: relative; height: 100vh; height: 100dvh; }
@media (min-width: 1100px) {
  .room { display: grid; grid-template-columns: 370px min(var(--col), calc(100vw - 400px)); justify-content: center; }
  .room > .chat { width: 100%; height: 100vh; height: 100dvh; margin: 0; }
  .game { height: 100vh; height: 100dvh; overflow-y: auto; padding: 22px 20px; border-left: 1px solid rgba(255, 51, 85, .18); background: linear-gradient(180deg, rgba(10, 4, 7, .78), rgba(10, 4, 7, .6) 40%, rgba(10, 4, 7, .82)); }
  .game-stakes-toggle { display: none; }
}
@media (max-width: 1099.98px) {
  .room { display: flex; flex-direction: column; width: min(var(--col), 100%); margin: 0 auto; background: linear-gradient(180deg, rgba(10, 4, 7, .72), rgba(10, 4, 7, .55) 40%, rgba(10, 4, 7, .78)); border-inline: 1px solid rgba(255, 51, 85, .18); box-shadow: 0 0 80px rgba(0, 0, 0, .7); }
  .room > .chat { display: contents; }
  .room .chat-header { order: 1; }
  .room .game { order: 2; padding: 10px 14px 12px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(26, 6, 12, .9), rgba(16, 4, 8, .8)); }
  .room .messages-wrap { order: 3; }
  .room .composer { order: 4; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .game:not(.game--stakes-open) .game-stakes, .game:not(.game--stakes-open) .game-expiry { display: none; }
  .game-host { padding-top: 0; border-top: 0; }
  .game-host .btn { min-height: 34px; }
  .game-title { font-size: 20px; }
  .game-glyph svg { width: 26px; height: 26px; }
}
@media (max-width: 720px) {
  .room { border-inline: 0; }
}

.chat-header .back-btn { grid-column: 1; color: #ffb3bf; }
.chat-header .pill { grid-column: 2; }
.chat-header .who { grid-column: 3; grid-row: 1; }
.chat-header .header-avatar { grid-column: 4; grid-row: 1; display: grid; place-items: center; }
.header-avatar .initial, .group-avatar .initial { font-size: 1.4em; }

/* ---------------- game panel ---------------- */
.game { display: grid; align-content: start; gap: 14px; }
.game-head { display: flex; align-items: center; gap: 12px; }
.game-titles { flex: 1; min-width: 0; }
.game-title { font: 600 24px/1.15 var(--font-name); letter-spacing: .04em; color: #ffd9de; text-shadow: 0 0 14px rgba(255, 51, 85, .5); }
.score { display: flex; align-items: center; gap: 8px; flex: none; }
.score-side { display: grid; justify-items: center; min-width: 46px; }
.score-side b { font: 700 24px/1 var(--font-name); color: #fff; font-variant-numeric: tabular-nums; }
.score-side small { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); }
.score-side--guest b { color: #ffc2de; }
.score-side--host b { color: #ff9a9a; }
.score-sep { font: 700 20px/1 var(--font-name); color: var(--mist); }
.game-stakes-toggle { justify-self: start; padding: 2px 0; border: 0; background: none; cursor: pointer; font-size: 13px; font-weight: 600; letter-spacing: .06em; color: #ffb3bf; }
.game-stakes-toggle::after { content: " ▾"; }
.game--stakes-open .game-stakes-toggle::after { content: " ▴"; }

.game-stakes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.stake { --c: 10px; --b: 1.5px; --shape: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c)); position: relative; isolation: isolate; display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; clip-path: var(--shape); background: var(--edge, rgba(255, 255, 255, .12)); }
.stake::before { content: ""; position: absolute; inset: var(--b); z-index: -1; clip-path: var(--shape); background: var(--fill, linear-gradient(170deg, #1d0b11, #12070a)); }
.stake--guest { --edge: linear-gradient(160deg, #ff8cc0, #6b1a3e); --fill: linear-gradient(170deg, #2a0a1c, #150610); }
.stake--host { --edge: linear-gradient(160deg, #ff5a5a, #5a0a12); --fill: linear-gradient(170deg, #2c070c, #160407); }
.stake--green { --edge: linear-gradient(160deg, #5ad67a, #134d22); --fill: linear-gradient(170deg, #0b2412, #07150b); }
.stake--black { --edge: linear-gradient(160deg, #d2a94f, #3a2a12); --fill: linear-gradient(170deg, #1a141a, #0c090c); }
.stake-face { flex: none; width: 34px; height: 34px; }
.stake-face svg { width: 100%; height: 100%; }
.stake-body { display: grid; gap: 1px; min-width: 0; }
.stake-who { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #ffd0d6; }
.stake--guest .stake-who { color: #ffb8d8; }
.stake--green .stake-who { color: #9be3a4; }
.stake--black .stake-who { color: #e3c06a; }
.stake-text { overflow-wrap: anywhere; white-space: pre-line; color: var(--bone); font-size: 14.5px; line-height: 1.4; }
.stake-text--empty { color: var(--mist); font-style: italic; }
.stake .wheel-chip { margin-top: .35em; }

.game-actions { display: grid; gap: 6px; }
.game-actions .hint { margin: 0; min-height: 1.2em; text-align: center; }
@media (max-width: 1099.98px) { .game-actions .hint:empty { display: none; } }
.btn--pulse { animation: play-pulse 1.4s ease-in-out infinite; }
@keyframes play-pulse { 50% { filter: drop-shadow(0 0 18px rgba(255, 51, 85, .85)); transform: scale(1.02); } }
.game-host { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.game-host .btn { flex: 1 1 auto; }
.game-expiry { margin: 0; font-size: 12px; text-align: center; }
.game-wait { display: grid; gap: 10px; padding: 12px 14px; border-left: 2px solid var(--crimson); background: rgba(255, 255, 255, .04); font-size: 14px; }
.game-wait strong { font: 600 17px var(--font-name); color: #ffd9de; }

@media (max-width: 1099.98px) {
  .game { gap: 10px; }
  .game-head { gap: 10px; }
  .score-side b { font-size: 20px; }
  .game-actions { grid-template-columns: 1fr; }
  .btn--big { min-height: 48px; font-size: 16px; }
}

/* ---------------- thread extras ---------------- */
.round-card { --c: 12px; --b: 1.5px; --shape: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  position: relative; isolation: isolate; align-self: center; display: grid; justify-items: center; gap: 4px; width: min(460px, 94%); margin: 18px auto 6px; padding: 12px 18px 14px; text-align: center;
  clip-path: var(--shape); background: var(--edge, linear-gradient(90deg, rgba(255, 51, 85, .15), rgba(255, 51, 85, .75), rgba(255, 51, 85, .15))); }
.round-card::before { content: ""; position: absolute; inset: var(--b); z-index: -1; clip-path: var(--shape); background: var(--fill, linear-gradient(180deg, rgba(48, 8, 20, .94), rgba(24, 6, 12, .94))); }
.round-card--guest { --edge: linear-gradient(90deg, rgba(255, 140, 192, .2), #ff8cc0, rgba(255, 140, 192, .2)); --fill: linear-gradient(180deg, rgba(56, 10, 36, .95), rgba(26, 6, 18, .95)); }
.round-card--host { --edge: linear-gradient(90deg, rgba(255, 90, 90, .2), #ff4a4a, rgba(255, 90, 90, .2)); }
.round-card--waiting { display: none; }
.round-card--new { animation: round-in .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes round-in { from { opacity: 0; transform: translateY(10px) scale(.94); } }
.round-label { font-size: 11px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--crimson); }
.round-card--guest .round-label { color: #ff8cc0; }
.round-result { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; font: 600 19px/1.3 var(--font-name); color: #ffe7ea; }
.round-face { width: 30px; height: 30px; }
.round-face svg { width: 100%; height: 100%; }
.round-hands { font-size: 22px; letter-spacing: .1em; }
.round-verdict { font: 700 15px/1.3 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: #ffd36b; }
.round-stake { max-width: 40ch; white-space: pre-line; overflow-wrap: anywhere; font: italic 15.5px/1.45 var(--font-name); color: #f3dce1; }
.round-by { font-size: 11.5px; color: var(--mist); letter-spacing: .05em; }

.bubble .link { color: #ffc2ca; text-decoration: underline; overflow-wrap: anywhere; }
.attachment--chat { width: 260px; background: rgba(255, 255, 255, .04); }
.attachment--chat img { aspect-ratio: var(--ar, auto); object-fit: cover; }
.bubble--media .attachment { margin: 2px 0; }

/* the picker: emotes go into the text, stickers are sent at once */
.picker-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: none; }
.picker-tab { min-height: 36px; border: 0; cursor: pointer; font-weight: 600; letter-spacing: .04em; color: var(--mist); background: rgba(255, 255, 255, .04); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.picker-tab:hover { color: var(--bone); }
.picker-tab[aria-selected="true"] { color: #fff; background: linear-gradient(160deg, #ff3355, #8a0c24); }
.emote-tile[title]::after { content: none; }

.composer .send svg { pointer-events: none; }
.attach-preview .attach-label small { color: var(--mist); }

/* ---------------- rock-paper-scissors duel extras ---------------- */
.rps-duel__status { min-height: 1.4em; font-size: clamp(.9rem, 2.4vmin, 1.1rem); letter-spacing: .06em; color: #ffd0d6; text-align: center; text-shadow: 0 1px 6px #000; }
.rps-duel__mark { display: none; }
.rps-duel__side--secret { position: relative; }
.rps-duel__side--secret .rps-duel__mark { display: grid; place-items: center; position: absolute; left: 50%; top: 0; translate: -50% 0; width: clamp(96px, 17vh, 160px); height: clamp(96px, 17vh, 160px); border-radius: 50%; font: 900 clamp(2.4rem, 7vh, 4rem)/1 LilaWheelText, Georgia, serif; color: #e3c06a; background: radial-gradient(circle at 35% 30%, #4a1020, #1a050b 70%); border: 3px solid #c99a41; box-shadow: inset 0 0 18px rgba(0, 0, 0, .85), 0 0 22px rgba(215, 31, 54, .45); animation: offer-wobble 2.4s ease-in-out infinite; }
.rps-duel__stake { max-width: min(92vw, 560px); min-height: 1.3em; text-align: center; font: italic clamp(1rem, 2.6vmin, 1.25rem)/1.4 var(--font-name); color: #ffe9b0; white-space: pre-line; overflow-wrap: anywhere; text-shadow: 0 1px 8px #000; }
@keyframes offer-wobble { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-10deg); } 86% { transform: rotate(8deg); } 93% { transform: rotate(-4deg); } }

/* ---------------- dialogs in the room ---------------- */
.dialog--wide { max-width: 620px; }
.dialog-close { flex: none; }
.room-menu { display: grid; gap: 10px; }
.room-menu .btn { justify-content: flex-start; }
.dialog .hint { margin-top: 0; }

/* ---------------- the settings editor ---------------- */
.editor { display: grid; gap: 4px; }
.editor .field { margin-bottom: 12px; }
.editor textarea { display: block; width: 100%; min-height: 64px; padding: 10px 14px; border: 1px solid rgba(255, 51, 85, .28); border-radius: 0; background: #0f0508; color: var(--bone); font: inherit; font-size: 16px; line-height: 1.4; resize: vertical; }
.editor textarea:focus-visible, .editor select:focus-visible { outline: none; border-color: var(--crimson); box-shadow: 0 0 0 1px var(--crimson), 0 0 14px rgba(255, 51, 85, .35); }
.field--win label { color: #ffb8d8; }
.field--lose label { color: #ff9a9a; }
.editor-coin-note { margin: -4px 0 8px; }
.editor-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.editor-label { margin-bottom: 8px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #d9b4bc; }
.editor-fields { display: grid; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; counter-reset: field; }
.editor-field { display: grid; grid-template-columns: 10px minmax(118px, 150px) minmax(0, 1fr) 40px; align-items: center; gap: 8px; }
.editor-swatch { width: 10px; align-self: stretch; background: #f0247a; }
.editor-field[data-kind="green"] .editor-swatch { background: #2c9c45; }
.editor-field[data-kind="red"] .editor-swatch { background: #c4141f; }
.editor-field[data-kind="black"] .editor-swatch { background: #241d24; box-shadow: inset 0 0 0 1.5px #d2a94f; }
.editor-kind { min-height: 46px; padding: 0 8px; border: 1px solid rgba(255, 51, 85, .28); border-radius: 0; background: #0f0508; color: var(--bone); font: inherit; font-size: 14px; }
.editor-text { min-height: 46px; }
.editor-remove { display: grid; place-items: center; width: 40px; height: 40px; border: 0; cursor: pointer; color: #ffb3bf; background: rgba(255, 255, 255, .06); clip-path: var(--hex); }
.editor-remove:hover:not(:disabled) { color: #fff; background: rgba(255, 51, 85, .3); }
.editor-remove:disabled { opacity: .35; cursor: default; }
.editor-add { justify-self: start; }
@media (max-width: 520px) {
  .editor-field { grid-template-columns: 8px minmax(0, 1fr) 40px; grid-template-areas: "sw kind rm" "sw text text"; }
  .editor-swatch { grid-area: sw; }
  .editor-kind { grid-area: kind; }
  .editor-text { grid-area: text; }
  .editor-remove { grid-area: rm; }
}

/* ---------------- game choice cards (host) ---------------- */
.game-choice { --c: 14px; --b: 1.5px; --shape: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  position: relative; isolation: isolate; display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 150px; padding: 18px 12px; border: 0; cursor: pointer; text-align: center; color: var(--bone);
  clip-path: var(--shape); background: var(--edge, linear-gradient(160deg, #6b2a3a, #2c1219)); transition: transform .15s; }
.game-choice::before { content: ""; position: absolute; inset: var(--b); z-index: -1; clip-path: var(--shape); background: var(--fill, linear-gradient(170deg, #1d0b11, #12070a)); }
.game-choice:hover, .game-choice:focus-visible, .game-choice[aria-checked="true"] { --edge: linear-gradient(160deg, #ff8a3d, #ff3355 50%, #a10f2a); outline: none; transform: translateY(-2px); }
.game-choice[aria-checked="true"] { --fill: linear-gradient(170deg, #3a0a16, #1a060c); }
.game-choice-title { font: 600 19px/1.2 var(--font-name); color: #ffd9de; }
.game-choice-blurb { font-size: 13px; line-height: 1.35; color: var(--mist); }
.game-choice--small { min-height: 84px; padding: 10px 6px; gap: 4px; }
.game-choice--small .game-choice-title { font-size: 14.5px; }

/* ---------------- host page ---------------- */
.host { min-height: 100dvh; padding: calc(22px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.host-inner { width: min(760px, 100%); margin: 0 auto; display: grid; gap: 18px; }
.host-head { display: flex; align-items: center; gap: 14px; }
.host-head .hex { width: 58px; height: 58px; filter: drop-shadow(0 0 12px rgba(255, 51, 85, .5)); }
.host-head h1 { flex: 1; min-width: 0; font: 600 30px/1.1 var(--font-name); letter-spacing: .05em; color: #ffd9de; text-shadow: 0 0 18px rgba(255, 51, 85, .55); }
.host-section-title { font: 600 20px var(--font-name); letter-spacing: .04em; color: #ffd9de; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 620px) { .choices { grid-template-columns: 1fr; } .game-choice { min-height: 0; grid-template-columns: auto 1fr; justify-items: start; text-align: left; } .game-choice .game-glyph { grid-row: span 2; } }
.lobbies { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lobby { --c: 12px; --edge: linear-gradient(160deg, #6b2a3a, #2c1219); --fill: linear-gradient(170deg, #1d0b11, #12070a); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; padding: 14px 16px; }
.lobby .game-glyph { grid-row: span 3; align-self: center; }
.lobby-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font: 600 18px/1.25 var(--font-name); color: #ffd9de; }
.lobby-meta { font-size: 13px; color: var(--mist); }
.lobby-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; rotate: 45deg; background: #7a6a70; }
.dot--on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.wizard-steps { display: flex; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--mist); }
.wizard-steps [aria-current="step"] { color: var(--crimson); }
.created { display: grid; gap: 14px; justify-items: center; text-align: center; }
.created .copy-row { width: 100%; }
.empty-note { padding: 18px; text-align: center; color: var(--mist); border: 1px dashed rgba(255, 51, 85, .3); }

/* ---------------- landing ---------------- */
.landing-note { text-align: center; color: #e6c9cf; font-size: 15.5px; line-height: 1.5; }
