/* One full-width arena. Menus and match summaries are overlays, never columns. */
body {
  overflow:hidden
}
.friends-waiting{margin:12px 0;padding:16px;border:1px dashed #668047;border-radius:10px;color:#d5e6ba;font-size:15px;font-weight:700;text-align:center}
.app-shell {
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr);
  padding:0 18px 14px
}
.header {
  min-width:0;
  min-height:64px;
  position:relative;
  z-index:15
}
.header-actions {
  gap:9px;
  min-width:0;
  flex-wrap:wrap;
  justify-content:flex-end
}
main { min-width:0; }
.brand { flex-shrink:0; }
.top-chip {
  min-height:36px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid #3c4f40;
  border-radius:8px;
  background:#1b291f;
  color:#c5d4c4;
  padding:7px 13px;
  font-size:12px;
  font-weight:700;
  white-space:nowrap
}
.top-chip:hover {
  border-color:var(--lime);
  color:var(--lime)
}
.mode-switch {
  border-color:#6d8553;
  color:var(--lime);
  background:#26341d
}
#top-leave {
  color:#e0baae;
  background:transparent
}
.game-menu {
  position:relative
}
.game-menu>summary {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  list-style:none;
  cursor:pointer;
  min-height:38px;
  padding:8px 12px;
  border:1px solid #384b3b;
  border-radius:8px;
  font-size:13px;
  color:#e1eadb
}
.game-menu>summary::-webkit-details-marker {
  display:none
}
.menu-popover {
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  width:244px;
  max-height:calc(100dvh - 85px);
  overflow:auto;
  background:#17241bef;
  border:1px solid #536749;
  border-radius:12px;
  padding:10px;
  box-shadow:0 18px 65px #0009;
  backdrop-filter:blur(18px);
  display:grid;
  gap:3px
}
.menu-action {
  border:0;
  background:none;
  color:#d7e3cc;
  border-radius:7px;
  min-height:40px;
  padding:11px 12px;
  text-align:left;
  font-size:13px
}
.menu-action:hover {
  background:#2c3b25;
  color:var(--lime)
}
.menu-action small {
  color:#8d9c85;
  margin-left:6px
}
.menu-records {
  font-size:11px;
  line-height:1.6;
  color:#abc798;
  padding:7px
}
.menu-popover .save-status {
  font-size:10px;
  border-top:1px solid #35492f;
  padding-top:10px
}
.menu-popover #sound-button {
  border-radius:8px;
  margin:4px 10px
}
.menu-popover #score-button {
  display:block
}
#result-details-button {
  color:#dbefa2
}
.game-layout {
  position:relative;
  display:flex;
  flex-direction:column;
  grid-template-columns:none;
  height:100%;
  border-radius:16px
}
.arena-panel {
  position:relative;
  flex:1;
  min-height:0;
  min-width:0;
  display:block!important;
  inset:auto
}
.arena-stage,body[data-ruleset="domination"] .arena-stage {
  position:absolute;
  inset:0;
  display:block
}
.arena-top {
  top:15px;
  left:18px;
  right:18px;
  pointer-events:none
}
.arena-bottom {
  bottom:15px;
  left:18px;
  right:18px
}
.journey-top {
  flex:0 0 auto;
  background:#17221b;
  border-bottom:1px solid #354a32;
  min-width:0
}
.journey-top .menu-progress {
  margin:0;
  padding:10px 18px;
  display:grid;
  grid-template-columns:110px minmax(130px,1fr) minmax(200px,1.2fr) 130px;
  gap:18px;
  align-items:center
}
.journey-top .journey-meta {
  font-size:10px;
  display:flex;
  flex-direction:column;
  align-items:start;
  gap:5px
}
.journey-top .journey-meta:last-child {
  align-items:end
}
.journey-top h3 {
  font-size:15px;
  margin:0
}
.journey-top .goal-strip {
  margin:0;
  gap:20px
}
.journey-top .goal-chip {
  display:grid;
  grid-template-columns:1fr auto;
  gap:4px;
  align-items:center
}
.journey-top .goal-chip span {
  font-size:10px
}
.journey-top .goal-chip strong {
  font-size:12px;
  margin:0
}
.journey-top .goal-chip progress {
  grid-column:1/-1;
  margin:0
}
.dom-menu-card {
  display:flex;
  align-items:center;
  gap:18px;
  margin:0;
  padding:17px 20px
}
.dom-menu-card strong {
  font-size:12px;
  letter-spacing:1px;
  color:var(--lime)
}
.dom-menu-card>span {
  font-size:12px
}
.mobile-match-info {
  display:grid;
  grid-template-columns:minmax(170px,.8fr) minmax(250px,1.2fr) auto;
  align-items:center;
  gap:20px;
  padding:9px 18px;
  border:0;
  background:none
}
.mobile-match-line {
  display:flex;
  flex-direction:column;
  align-items:start;
  gap:6px
}
#mobile-kind {
  font-size:12px;
  color:var(--lime)
}
#mobile-count {
  font-size:11px;
  color:#c3cdbb;
  font-variant-numeric:tabular-nums
}
#mobile-phase {
  font-size:10px;
  color:#e9d7aa;
  max-width:170px
}
#mobile-goals .goal-instruction {
  font-size:10px;
  margin:0 0 5px
}
#mobile-goals .goal-strip {
  margin:0;
  gap:16px
}
#mobile-goals .goal-chip {
  display:grid;
  grid-template-columns:1fr auto;
  gap:3px
}
#mobile-goals .goal-chip strong {
  margin:0;
  font-size:12px
}
#mobile-goals .goal-chip progress {
  grid-column:1/-1;
  margin:0
}
.dom-hud {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  border:0;
  background:none;
  padding:13px 20px
}
.dom-hud>div:first-child {
  gap:18px;
  float:none
}
#dom-merge {
  font-size:11px
}
.dom-numbers {
  margin:0
}
.in-match #profile-card,.in-match #dom-menu-card {
  display:none!important
}
body[data-view="lobby"] .journey-top {
  display:none
}
body[data-view="result"] #mobile-match-info {
  display:grid!important
}
body[data-view="playing"] .arena-top,body[data-view="result"] .arena-top {
  display:none
}
.entry-card,.lobby-card {
  position:absolute;
  z-index:5;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:min(460px,calc(100% - 32px));
  max-height:calc(100% - 24px);
  overflow:auto;
  margin:0;
  padding:22px;
  background:#152019ed;
  border:1px solid #5b7651;
  border-radius:18px;
  box-shadow:0 24px 90px #0008,0 0 0 6px #13201960;
  backdrop-filter:blur(16px)
}
.lobby-card { overscroll-behavior:contain; }
.member-row > span:nth-child(2) { min-width:0; overflow-wrap:anywhere; }
.member-row small { flex-shrink:0; }
.dom-overlay { max-height:calc(100% - 24px); overflow:auto; overscroll-behavior:contain; }
.dom-overlay.private-lobby > strong { font-size:clamp(28px,7vw,46px); letter-spacing:3px; margin:10px 0; }
#dom-overlay-invite { margin:0 0 12px; min-height:42px; }
#menu-view .ruleset-selector {
  padding:6px;
  gap:6px;
  border-radius:13px;
  margin:0 0 16px
}
#menu-view .ruleset-selector button {
  padding:16px 10px;
  font-size:18px;
  border-radius:9px
}
#play-form {
  display:block
}
#menu-view .input-wrap {
  height:56px;
  margin:0 0 12px;
  border-radius:11px;
  padding:0 15px
}
#menu-view input {
  font-size:21px
}
#menu-view .input-counter {
  font-size:11px
}
#menu-view .play-button {
  min-height:68px;
  border-radius:11px;
  padding:14px 18px
}
#menu-view #play-label {
  font:32px/1 var(--display)
}
#menu-view .play-button>span:last-child {
  font:40px/1 Arial
}
#menu-view .control-note {
  display:block;
  margin:15px 0 0;
  font-size:11px
}
.chosen-mode {
  font-size:11px;
  letter-spacing:2px;
  color:var(--lime);
  margin:0 0 16px;
  font-weight:800;
  text-align:center
}
.center-overlay {
  background:#10181045;
  backdrop-filter:blur(3px)
}
.lobby-card h2 {
  margin-top:4px
}
.lobby-card .intro {
  margin-bottom:10px
}
.dom-overlay {
  z-index:5
}
.dom-leave-arena {
  display:none!important
}
.dom-last-result {
  display:none!important
}
.round-overlay {
  position:absolute;
  inset:0;
  z-index:8;
  display:grid;
  place-items:center;
  background:radial-gradient(ellipse at center,#142310a8,#080e099c);
  backdrop-filter:blur(5px);
  overflow:hidden;
  pointer-events:auto
}
.round-card {
  position:relative;
  z-index:1;
  text-align:center;
  width:min(530px,calc(100% - 32px));
  padding:16px;
  max-height:100%;
  overflow:auto
}
.round-symbol {
  margin:0 auto 16px;
  width:88px;
  height:88px;
  display:grid;
  place-items:center;
  border-radius:28px;
  transform:rotate(-8deg);
  background:linear-gradient(135deg,#e9ffac,#b0ef3c);
  color:#213411;
  font:66px/1 Arial;
  box-shadow:0 0 75px #caff553b,0 7px 0 #597e25
}
.round-kicker {
  color:#cfff98;
  font-size:10px;
  letter-spacing:3px;
  font-weight:800;
  margin:0 0 12px
}
.round-card h2 {
  font-size:clamp(38px,6vw,84px);
  line-height:.95;
  letter-spacing:-1px;
  color:#eaffc8;
  text-shadow:0 4px 0 #426425;
  margin:0 0 14px
}
.round-place {
  font-size:14px;
  color:#e3edda;
  margin:0 0 14px
}
.round-reward {
  display:block;
  color:var(--lime);
  font-size:20px;
  margin:14px 0 8px;
  line-height:1.2
}
.round-note {
  font-size:12px;
  color:#c5d6b5;
  line-height:1.55;
  max-width:390px;
  margin:8px auto 18px;
  min-height:18px
}
.round-counter {
  width:66px;
  height:66px;
  display:grid;
  place-items:center;
  margin:18px auto 0;
  border-radius:50%;
  border:2px solid #a7d26c;
  box-shadow:0 0 0 7px #caff550d,0 0 40px #caff5514;
  color:#e9ffc7;
  background:#162712cf;
  font:39px/1 var(--display);
  font-variant-numeric:tabular-nums
}
.round-overlay[data-won="false"] .round-symbol {
  background:linear-gradient(135deg,#ffd5b1,#ff8a76);
  color:#6c2e34;
  box-shadow:0 0 75px #ff897833,0 7px 0 #863f43;
  transform:rotate(12deg)
}
.round-overlay[data-won="false"] h2 {
  color:#ffdbbd;
  text-shadow:0 4px 0 #793e45
}
.round-overlay[data-won="false"] .round-kicker {
  color:#ffbbaa
}
.round-overlay[data-won="false"] .round-counter {
  border-color:#e8aa97;
  color:#ffe0c9;
  background:#362024ba
}
.round-confetti {
  position:absolute;
  inset:0;
  pointer-events:none
}
.round-confetti i {
  position:absolute;
  left:var(--x);
  top:-20px;
  width:9px;
  height:17px;
  background:var(--color);
  border-radius:2px;
  animation:round-confetti 1.2s cubic-bezier(.13,.51,.43,1) var(--delay) both
}
.round-confetti i:nth-child(3n) {
  width:7px;
  height:7px;
  border-radius:50%
}
.round-confetti i:nth-child(4n) {
  height:22px;
  width:4px
}
.round-card .secondary-button {
  max-width:210px;
  margin:14px auto;
  color:#e4f0d5;
  background:#24341bd9
}
.round-overlay-open #countdown,.round-overlay-open #dom-overlay,.round-overlay-open #lobby-view {
  visibility:hidden
}
.round-overlay-open #dom-touch {
  visibility:hidden
}
#score-dialog,#result-dialog {
  z-index:30
}
#score-dialog .view {
  margin:12px 0 0
}
#score-dialog #match-kind {
  padding-right:20px
}
#score-dialog #playing-view .match-hud {
  position:static
}
#score-dialog .leaderboard {
  max-height:45dvh;
  overflow:auto
}
#result-dialog .result-actions {
  position:static;
  box-shadow:none;
  padding:10px 0
}
#result-dialog #result-title {
  font-size:32px
}
#result-dialog .result-place {
  font-size:14px
}
.emote-bar button {
  min-width:36px
}
.game-menu[open]>summary {
  color:var(--lime);
  border-color:#a7c379
}
@keyframes round-confetti {
  0% {
    opacity:1;
    transform:translate3d(0,-30px,0) rotate(0)
  }
  70% {
    opacity:1
  }
  100% {
    opacity:0;
    transform:translate3d(var(--drift),min(70vh,650px),0) rotate(var(--spin))
  }
}
@media(max-width:1000px) {
  .journey-top .menu-progress {
    grid-template-columns:86px minmax(100px,.6fr) minmax(220px,1.4fr);
    gap:14px
  }
  .journey-top .journey-meta:last-child {
    display:none
  }
  .mobile-match-info {
    grid-template-columns:1fr 1.4fr;
    gap:12px
  }
  #mobile-phase {
    grid-column:1/-1;
    max-width:none;
    position:absolute;
    right:16px;
    top:64px;
    font-size:9px;
    display:none
  }
  .mobile-match-info .mobile-match-line {
    gap:5px
  }
  .dom-hud {
    flex-wrap:wrap;
    gap:7px 18px
  }
  #dom-merge {
    margin-left:auto
  }
}
@media(max-width:760px) {
  .app-shell {
    padding:0 0 env(safe-area-inset-bottom);
    grid-template-rows:auto minmax(0,1fr)
  }
  .header {
    min-height:54px;
    padding:7px 10px;
    gap:8px
  }
  .header-actions { flex:1; }
  body[data-view="lobby"] #top-journey { display:none; }
  .brand {
    font-size:21px;
    gap:5px
  }
  .brand-ball {
    width:24px;
    height:24px;
    font-size:24px
  }
  .header-actions {
    gap:5px
  }
  .top-chip {
    font-size:10px;
    padding:7px 8px;
    min-height:32px;
    gap:4px
  }
  .game-menu>summary {
    min-height:32px;
    padding:6px 9px;
    font-size:15px
  }
  .game-menu>summary>span {
    display:none
  }
  .game-layout {
    border:0;
    border-top:1px solid #344530;
    border-radius:0;
    display:flex
  }
  .arena-panel {
    position:relative;
    inset:auto
  }
  .journey-top .menu-progress {
    grid-template-columns:75px 1fr;
    padding:9px 12px;
    gap:8px
  }
  .journey-top .menu-progress h3 {
    font-size:13px
  }
  .journey-top .menu-progress .goal-strip {
    grid-column:1/-1;
    gap:14px
  }
  .journey-top .journey-meta {
    flex-direction:row;
    align-items:center;
    gap:4px;
    font-size:9px
  }
  .journey-top .journey-meta>span {
    display:none
  }
  .journey-top .journey-meta>strong {
    font-size:10px
  }
  .journey-top .goal-chip span {
    font-size:9px
  }
  .journey-top .goal-chip strong {
    font-size:11px
  }
  .mobile-match-info {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:4px;
    padding:9px 12px
  }
  .mobile-match-line {
    flex-direction:row;
    align-items:center;
    justify-content:space-between
  }
  #mobile-kind {
    font-size:10px
  }
  #mobile-count {
    font-size:10px
  }
  #mobile-goals .goal-instruction {
    font-size:9px;
    margin:2px 0 5px
  }
  #mobile-goals .goal-strip {
    gap:12px
  }
  #mobile-goals .goal-chip span {
    font-size:9px
  }
  #mobile-goals .goal-chip strong {
    font-size:11px
  }
  #mobile-phase {
    position:static;
    display:block;
    font-size:9px;
    max-width:none;
    margin:3px 0 0
  }
  #dom-merge {
    font-size:9px;
    margin:0
  }
  .dom-hud {
    padding:10px 12px;
    display:grid;
    grid-template-columns:1fr auto;
    gap:7px
  }
  .dom-hud>div:first-child {
    gap:10px;
    grid-column:1/-1
  }
  .dom-numbers {
    gap:12px;
    grid-column:1/-1
  }
  #dom-merge {
    grid-column:1/-1
  }
  .dom-menu-card {
    padding:13px 14px;
    justify-content:space-between;
    gap:8px
  }
  .dom-menu-card>span {
    font-size:10px
  }
  .entry-card {
    padding:18px;
    width:min(440px,calc(100% - 28px))
  }
  #menu-view .ruleset-selector button {
    font-size:16px;
    padding:13px 8px
  }
  #menu-view .input-wrap {
    height:52px
  }
  #menu-view input {
    font-size:19px
  }
  #menu-view .play-button {
    min-height:60px
  }
  #menu-view #play-label {
    font-size:28px
  }
  .round-symbol {
    width:74px;
    height:74px;
    font-size:54px;
    margin-bottom:18px;
    border-radius:24px
  }
  .round-card h2 {
    font-size:52px
  }
  .round-reward {
    font-size:18px
  }
  .round-note {
    font-size:11px
  }
  .round-kicker {
    font-size:9px;
    letter-spacing:2px
  }
  .round-counter {
    width:60px;
    height:60px;
    font-size:35px
  }
  .lobby-card {
    padding:20px
  }
  #top-journey {
    padding:7px 6px
  }
  body[data-view="menu"] #top-journey {
    display:none
  }
  .arena-top {
    left:12px;
    right:12px;
    top:12px
  }
  .arena-bottom {
    left:12px;
    right:12px;
    font-size:10px
  }
}
@media(max-width:380px) {
  .brand {
    font-size:18px;
    gap:4px
  }
  .brand-ball {
    width:20px;
    height:20px;
    font-size:20px
  }
  .top-chip {
    font-size:9px;
    padding:7px 6px
  }
  .header {
    gap:5px;
    padding-inline:8px
  }
  .header-actions {
    gap:4px
  }
  .entry-card {
    padding:15px
  }
  #menu-view .ruleset-selector button {
    font-size:14px
  }
  #menu-view #play-label {
    font-size:25px
  }
  .round-card h2 {
    font-size:44px
  }
  .round-symbol {
    width:64px;
    height:64px;
    font-size:46px;
    margin-bottom:14px
  }
  .round-note {
    margin-bottom:12px
  }
  .round-place {
    margin-bottom:9px
  }
  .round-counter {
    margin-top:12px
  }
}
@media(max-height:520px) {
  .header {
    min-height:44px;
    padding-block:4px
  }
  .entry-card {
    padding:13px 18px;
    width:min(400px,calc(100% - 28px))
  }
  #menu-view .ruleset-selector {
    margin-bottom:9px;
    padding:4px
  }
  #menu-view .ruleset-selector button {
    padding:8px;
    font-size:14px
  }
  #menu-view .input-wrap {
    height:42px;
    margin-bottom:8px
  }
  #menu-view .input-wrap>span:first-child,#menu-view .input-counter {
    display:block
  }
  #menu-view .play-button {
    min-height:45px;
    padding:8px 12px
  }
  #menu-view #play-label {
    font-size:25px
  }
  #menu-view .control-note {
    font-size:10px;
    margin-top:9px
  }
  .chosen-mode {
    margin-bottom:10px
  }
  .journey-top .menu-progress {
    padding-block:7px
  }
  .mobile-match-info {
    padding-block:6px
  }
  .mobile-match-info .goal-instruction {
    display:none
  }
  #mobile-phase {
    display:none
  }
  .dom-hud {
    padding:7px 14px;
    display:flex;
    flex-wrap:wrap
  }
  .dom-hud>div:first-child {
    float:none
  }
  .dom-numbers {
    margin:0
  }
  .round-card {
    padding:10px;
    display:grid;
    grid-template-columns:62px 1fr;
    column-gap:18px;
    align-items:center;
    width:min(510px,calc(100% - 32px))
  }
  .round-symbol {
    grid-column:1;
    grid-row:1/5;
    width:60px;
    height:60px;
    font-size:44px;
    margin:0;
    border-radius:20px
  }
  .round-kicker {
    margin:0 0 6px;
    grid-column:2;
    font-size:9px
  }
  .round-card h2 {
    font-size:42px;
    grid-column:2;
    margin-bottom:7px
  }
  .round-place {
    grid-column:2;
    margin:0 0 4px;
    font-size:12px
  }
  .round-reward {
    grid-column:2;
    font-size:15px;
    margin:5px 0
  }
  .round-note {
    grid-column:2;
    margin:5px 0;
    font-size:10px;
    min-height:0
  }
  .round-counter {
    grid-column:2;
    width:48px;
    height:48px;
    font-size:30px;
    margin-top:10px
  }
  .round-card .secondary-button {
    grid-column:2;
    margin:8px auto 0;
    min-height:34px
  }
  .lobby-card {
    padding:14px 20px
  }
  .lobby-card h2 {
    font-size:26px
  }
  .lobby-card .member-list {
    max-height:65px;
    margin:8px 0
  }
}
@media(prefers-reduced-motion:reduce) {
  .round-confetti i {
    animation:none;
    top:calc(8% + var(--x));
    opacity:.35;
    transform:rotate(var(--spin))
  }
  .round-overlay {
    backdrop-filter:none
  }
}
