/* Entry screens shared by the first-paint loading page (index.html) and the menu frame (frontend/entry-screens.mjs).
   Units are device pixels of the 960x540 stage. The font file is the one the menu frame already uses. */
@font-face{font-family:Bungee;src:url('../../frontend/private/Browser%20Game/map-vote/assets/Bungee-Regular.ttf')}

:root{--menu-focus-gold:#ffcf36}
/* The imported landscape skin sets a white !important outline in a cascade layer. */
@layer landscape-priority{
 #device button:focus-visible{outline-color:var(--menu-focus-gold)!important}
 #device button.art-focus:focus{outline:none!important}
}
/* Stroke the visible plate, including its pulsing child and transparent corners. */
#device button.art-focus:focus-visible,
body:has(>.pad-focus:not([hidden])) #device button.art-focus:focus{
 filter:drop-shadow(2px 0 0 var(--menu-focus-gold)) drop-shadow(-2px 0 0 var(--menu-focus-gold))
        drop-shadow(0 2px 0 var(--menu-focus-gold)) drop-shadow(0 -2px 0 var(--menu-focus-gold))
        drop-shadow(0 1px 1px #81530b)
}
body:has(#device button.art-focus:focus)>.pad-focus{visibility:hidden}
@media(forced-colors:active){
 @layer landscape-priority{
  #device button.art-focus:focus-visible,body:has(>.pad-focus:not([hidden])) #device button.art-focus:focus{outline:3px solid Highlight!important;filter:none!important}
 }
}

/* Navy plate: cyan-blue rim, dark navy fill, angled corners. Drawn with CSS so it is sharp at any size.
   Set --cx / --cy (corner cut) and --rim / --base (rim and drop thickness) per use. */
.v79-plate{position:relative;isolation:isolate;--cx:26px;--cy:14px;--rim:5px;--base:5px;--cut:polygon(var(--cx) 0,calc(100% - var(--cx)) 0,100% var(--cy),100% calc(100% - var(--cy)),calc(100% - var(--cx)) 100%,var(--cx) 100%,0 calc(100% - var(--cy)),0 var(--cy))}
.v79-plate::before,.v79-plate::after{content:'';position:absolute;z-index:-1;pointer-events:none}
.v79-plate::before{inset:0;clip-path:var(--cut);background:linear-gradient(#2aa9f4 0,#1488dc 55%,#0a64bd calc(100% - var(--base)),#020b2a calc(100% - var(--base)))}
.v79-plate::after{left:var(--rim);right:var(--rim);top:var(--rim);bottom:calc(var(--rim) + var(--base));
 clip-path:polygon(calc(var(--cx) - 4px) 0,calc(100% - var(--cx) + 4px) 0,100% calc(var(--cy) - 3px),100% calc(100% - var(--cy) + 3px),calc(100% - var(--cx) + 4px) 100%,calc(var(--cx) - 4px) 100%,0 calc(100% - var(--cy) + 3px),0 calc(var(--cy) - 3px));
 background:linear-gradient(#5f86bd,#5f86bd) center 2px/calc(100% - 2 * var(--cx)) 2px no-repeat,linear-gradient(#314c88 0,#2a4272 46%,#061c56 46%,#02113a 100%)}

/* Loading and load-failed screens. */
#device .phone.v79-load{width:960px!important;height:540px!important;inset:0!important;overflow:visible;color:#fff;font:22px Bungee,sans-serif;box-sizing:border-box;background:transparent}
#device .v79-load[hidden]{display:none!important}
#device .v79-load *{box-sizing:border-box}
#device .v79-load .v79-logo{position:absolute;pointer-events:none;object-fit:contain;left:2.5%;top:13%;width:54%;height:53%;transform:rotate(-1.5deg);transform-origin:50% 0}
#device .loading-performance-slot{position:absolute;pointer-events:none;left:55%;top:13%;width:40%;height:76%}
#device .loading-performance-image{display:block;position:absolute;pointer-events:none;inset:0;width:100%;height:100%;object-fit:contain}
#device .v79-load .load-slot{position:absolute!important;margin:0!important;left:11.5%;top:70%;width:36%;display:flex;flex-direction:column;gap:10px;align-items:stretch}
#device .v79-load .lstep{display:flex;justify-content:space-between;align-items:flex-end;padding:0 4px;font-size:26px;line-height:1;text-shadow:2px 0 #09264c,-2px 0 #09264c,0 2px #09264c,0 -2px #09264c,2px 2px #09264c,-2px 2px #09264c,2px -2px #09264c,-2px -2px #09264c}
#device .v79-load .lstep b{font-weight:400}
#device .v79-load .lbar{display:block;flex:none;height:46px;--cx:20px;--cy:11px;--rim:4px;--base:4px}
#device .v79-load .lbar-track{
 position:absolute;inset:8px 8px calc(8px + var(--base));overflow:hidden;
 clip-path:polygon(14px 0,calc(100% - 14px) 0,100% 7px,100% calc(100% - 7px),calc(100% - 14px) 100%,14px 100%,0 calc(100% - 7px),0 7px)
}
#device .v79-load .lbar i{display:block;height:100%;width:0;background:repeating-linear-gradient(90deg,transparent 0 18px,#a96f00 18px 20px),linear-gradient(#ffe45a,#ffc800 55%,#f0a800);transition:width .25s ease-out}
#device .v79-load button{display:flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;box-shadow:none;cursor:pointer;font:inherit;color:#fff;text-shadow:0 2px 1px #09264c;background:transparent}
#device .v79-load button:focus-visible{outline:3px solid #ffcf36;outline-offset:2px}
#device .v79-load .nosig{height:auto;justify-content:flex-start;padding:0 4px;font-size:34px;line-height:1;text-shadow:2px 0 #09264c,-2px 0 #09264c,0 2px #09264c,0 -2px #09264c,2px 2px #09264c,-2px 2px #09264c,2px -2px #09264c,-2px -2px #09264c}
#device .v79-load .load-actions{display:flex;gap:4%}
#device .v79-load .load-actions button{height:max(calc(46px / var(--ui-scale,1)),44px);font-size:max(20px,calc(17px / var(--ui-scale,1)))}
#device .v79-load .retry-btn{flex:3}
#device .v79-load .quit-btn{flex:2}

/* The rectangular button stays still so its touch area never moves with the art. */
#device .v79-mode .mode-choice {
  --mode-contact-shadow: color-mix(in srgb, var(--low) 33%, transparent);
  width: 100%;
  height: 85px;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

#device .v79-mode .mode-choice:focus-visible {
  outline-offset: 3px;
  filter: drop-shadow(0 0 3px var(--shine)) drop-shadow(0 0 7px var(--trim));
}

@media (hover: hover) and (pointer: fine) {
  #device .v79-mode .mode-choice:hover:not(:active) {
    filter: drop-shadow(0 0 3px var(--shine)) drop-shadow(0 0 7px var(--trim));
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #device .v79-mode .mode-choice:hover:not(:active) {
    animation: mode-hover-glow 1.35s ease-in-out infinite;
  }
}

@keyframes mode-hover-glow {
  0%, 100% {
    filter: drop-shadow(0 0 2px var(--shine)) drop-shadow(0 0 5px var(--trim));
  }
  50% {
    filter: drop-shadow(0 0 5px var(--shine)) drop-shadow(0 0 12px var(--trim));
  }
}

@property --plate-flow {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 50%;
}

@media (prefers-reduced-motion: no-preference) {
  button.menu-action:not(:disabled)::after, .v79-entry .mode-face {
    animation: plate-flow 7s ease-in-out var(--plate-flow-delay, 0s) infinite alternate;
  }
  .mode-choice:nth-child(even), .mode-nav button:nth-child(even), .menu-action:nth-child(even) {
    --plate-flow-delay: -3s;
  }
}

@keyframes plate-flow {
  from { --plate-flow: 21%; }
  to { --plate-flow: 79%; }
}

/* Action plates share the mode buttons' cut, palette, and bevel. The plate
   moves on press while the button's hit area and label stay in place. */
:where(.menu-action) { position: relative; }
#device .menu-action[data-plate] {
  isolation: isolate;
  background: none;
  color: #fffdf5;
  text-shadow: var(--title-depth, 0 2px #081a36, 0 3px 3px #14203b85);
  -webkit-tap-highlight-color: transparent;
}
.menu-action, .v79-entry .mode-plate {
  --surface-gloss: linear-gradient(169deg, #fff3, transparent 34%);
  --surface-color: linear-gradient(153deg, var(--light), var(--mid) 42%, var(--low));
  --edge: polygon(var(--upper-left) 0, calc(100% - var(--upper-right)) 0,
    100% var(--right-top), 100% calc(100% - var(--lower-right)),
    calc(100% - var(--lower-right)) 100%, var(--lower-left) 100%,
    0 calc(100% - var(--left-bottom)), 0 var(--upper-left));
  --upper-left: calc(17 * var(--plate-unit, 1px));
  --upper-right: calc(10 * var(--plate-unit, 1px));
  --right-top: calc(11 * var(--plate-unit, 1px));
  --lower-right: calc(15 * var(--plate-unit, 1px));
  --lower-left: calc(8 * var(--plate-unit, 1px));
  --left-bottom: calc(9 * var(--plate-unit, 1px));
}
.menu-action {
  --plate-unit: .82px;
  --plate-rim-inset: calc(2 * var(--plate-unit));
  --plate-base-inset: calc(5 * var(--plate-unit));
}
.menu-action::after {
  content: "";
  position: absolute;
  clip-path: var(--edge);
  pointer-events: none;
  z-index: -1;
  inset: var(--plate-rim-inset) var(--plate-rim-inset) var(--plate-base-inset);
  padding: var(--plate-rim-inset) var(--plate-rim-inset) var(--plate-base-inset);
  background:
    var(--plate-keyline, linear-gradient(90deg, var(--trim), transparent 51%, var(--shine))
      center bottom 1px / calc(100% - 2 * var(--upper-left)) 2px no-repeat content-box),
    var(--pattern) content-box,
    var(--surface-gloss) content-box,
    var(--surface-color) var(--plate-flow, 50%) 50% / 185% 125% no-repeat content-box,
    linear-gradient(160deg, var(--shine) 6%, var(--light) 27%, var(--low) 60%, var(--trim) 74%, var(--light));
  transition: translate 90ms ease, filter 90ms ease;
}
.menu-action:active:not(:disabled)::after {
  translate: 0 2px;
  filter: brightness(1.12);
}
.menu-action:focus-visible {
  outline: 3px solid #ffcf36;
  outline-offset: 2px;
}
.menu-action:disabled { opacity: .65; cursor: default; }
@media (prefers-reduced-motion: reduce) {
  .menu-action::after { transition: none; }
}

.v79-entry .mode-plate {
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter: drop-shadow(0 3px 1px #101b3766);
  transition: translate 90ms ease, filter 90ms ease;
}

.v79-mode .mode-choice .mode-plate {
  filter: drop-shadow(0 2px 2px var(--mode-contact-shadow));
}

.v79-entry .mode-plate::after,
.v79-entry .mode-face {
  content: "";
  position: absolute;
  clip-path: var(--edge);
}

.v79-entry .mode-plate::after {
  inset: 2px 2px 5px;
  z-index: 0;
  background: linear-gradient(160deg, var(--shine) 6%, var(--light) 27%, var(--low) 60%, var(--trim) 74%, var(--light));
}

.v79-entry .mode-face {
  inset: 4px 4px 10px;
  z-index: 1;
  background: var(--emblem-shade, linear-gradient(transparent, transparent)),
    var(--surface-gloss), var(--surface-color) var(--plate-flow, 50%) 50% / 185% 125% no-repeat;
}

.v79-entry .mode-face::before,
.v79-entry .mode-face::after {
  content: "";
  position: absolute;
}

.v79-entry .mode-face::before {
  inset: 0;
  background: var(--pattern);
}

.v79-entry .mode-face::after {
  inset: auto 17px 1px 12px;
  height: 2px;
  background: linear-gradient(90deg, var(--trim), transparent 51%, var(--shine));
  opacity: .85;
}

/* The first action uses the same gold shell as Brawl, with the title above it at the current centre line. */
#device .v79-title .v79-start {
  position: absolute;
  left: 11.5%;
  top: 70.5%;
  width: 36%;
  height: max(66px, calc(44px / var(--ui-scale, 1)));
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.v79-title .v79-start-label {
  position: relative;
  translate: 0 -4px;
  pointer-events: none;
  color: #fffdf5;
  font: 31px/1 Bungee, sans-serif;
  text-shadow: var(--title-depth);
}

.v79-title .v79-start .mode-face::before {
  /* The label sits 1px above the face center. The square covers its clipped corners at every angle. */
  inset: calc(50% - 1px) auto auto 50%;
  width: 120%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: repeating-conic-gradient(from 5deg, transparent 0 20deg, #ffed997b 22deg 27deg, transparent 30deg 45deg);
}

@media (prefers-reduced-motion: no-preference) {
  .v79-title .v79-start {
    animation: v79-start-pulse 1.9s ease-in-out infinite;
  }

  .v79-title .v79-start .mode-face::before {
    animation: v79-start-starburst 16s linear infinite;
  }

  @keyframes v79-start-pulse {
    0%, 90%, 100% { scale: 1; }
    45% { scale: 1.035; }
  }

  @keyframes v79-start-starburst {
    to { transform: rotate(1turn); }
  }
}

#device .v79-title .v79-start:active .mode-plate {
  translate: 0 2px;
  filter: brightness(1.12) drop-shadow(0 1px #101b3766);
}

#device .v79-mode .mode-title {
  position: absolute;
  z-index: 3;
  top: 45%;
  left: 28px;
  color: #fffdf5;
  font: 32px/1 Bungee, sans-serif;
  letter-spacing: -.018em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateY(-50%);
  text-shadow: 0 1px 1px color-mix(in srgb, var(--low) 70%, transparent);
}

#device .v79-mode [data-rules=capture-the-flag] .mode-title {
  left: max(17px, calc(14px / var(--ui-scale, 1)));
}

#device .v79-mode [data-rules=spar] .mode-title {
  font-size: 25px;
  letter-spacing: -.035em;
}

/* The four icons share one transparent atlas. Each quadrant is a separate prop. */
.v79-mode .mode-emblem {
  position: absolute;
  z-index: 2;
  width: 57px;
  height: 57px;
  right: 12px;
  top: 10px;
  background: url('./mode-emblems-v3.webp') var(--emblem-position, left top) / 200% 200% no-repeat;
  filter: drop-shadow(0 2px 1px #10213a76);
}

.v79-mode [data-rules=king-of-the-hill] .mode-emblem { --emblem-position: right top; }
.v79-mode [data-rules=capture-the-flag] .mode-emblem { --emblem-position: left bottom; }
/* Explore keeps the practice map picker and needs room for the longer label. */
.v79-mode [data-rules=spar] .mode-emblem {
  --emblem-position: right bottom;
  width: 53px;
  height: 53px;
  right: 11px;
  top: 12px;
}

.v79-mode [data-rules=brawl],
.v79-title .v79-start,
.menu-action[data-plate=gold] {
  --shine: #fff8b9;
  --trim: #ffaf35;
  --light: #ffda50;
  --mid: #ffb919;
  --low: #a6450a;
  --title-depth: 0 2px 0 #71410d, 0 3px 3px #54300880;
}

.v79-mode [data-rules=brawl] {
  --pattern: repeating-conic-gradient(from 5deg at 83% 50%, transparent 0 20deg, #ffed997b 22deg 27deg, transparent 30deg 45deg);
}
.menu-action[data-plate=gold] {
  --pattern: repeating-conic-gradient(from 5deg at 50% 50%, transparent 0 20deg, #fff2ae45 22deg 27deg, transparent 30deg 45deg);
}

/* The angled shade belongs to the right-hand emblem, not the button palette. */
.v79-mode :is([data-rules=king-of-the-hill], [data-rules=spar]) {
  --emblem-shade: linear-gradient(117deg, transparent 66%, #061a3c44 66.4%, transparent 91%);
}

.v79-mode [data-rules=king-of-the-hill],
.menu-action[data-plate=blue] {
  --shine: #bff4ff;
  --trim: #39a9fd;
  --light: #28b9fd;
  --mid: #1765ca;
  --low: #112774;
  --pattern: repeating-linear-gradient(151deg, transparent 0 29px, #6ce2ff38 29px 31px, #431bf52d 31px 36px, transparent 36px 54px);
}

.v79-mode [data-rules=capture-the-flag],
.menu-action[data-plate=red] {
  --shine: #ffdfeb;
  --trim: #ff7584;
  --light: #ff7078;
  --mid: #c73154;
  --low: #661c49;
  --pattern: repeating-linear-gradient(145deg, transparent 0 26px, #ffc4d134 26px 29px, transparent 29px 48px);
}
.v79-mode [data-rules=capture-the-flag] {
  --emblem-shade: linear-gradient(118deg, transparent 69%, #2a356b99 69.4%, #273466 93%);
}

.menu-action[data-plate=navy] {
  --shine: #90c9f0;
  --trim: #347fb8;
  --light: #285b92;
  --mid: #174074;
  --low: #142650;
  --pattern: repeating-linear-gradient(145deg, transparent 0 18px, #84ccff26 18px 20px, transparent 20px 31px);
}
.menu-action[data-plate=back] {
  --shine: #afd9f4;
  --trim: #5d9dce;
  --light: #4a75a3;
  --mid: #28537c;
  --low: #182d57;
  --pattern: linear-gradient(118deg, #c1e4ff26, transparent 54%);
}
.v79-mode [data-rules=spar] {
  --shine: #c9ffed;
  --trim: #66e6c6;
  --light: #3ee6bf;
  --mid: #119f8e;
  --low: #05535b;
  --pattern: repeating-linear-gradient(128deg, transparent 0 12px, #a1ffdf3d 12px 15px, transparent 15px 22px) right / 37% 100% no-repeat;
}

#device .v79-mode .mode-choice:active .mode-plate {
  translate: 0 2px;
  filter: brightness(1.12) drop-shadow(0 1px 1px var(--mode-contact-shadow));
}

@media (prefers-reduced-motion: no-preference) {
  .v79-mode [data-rules=brawl] .mode-plate {
    animation: mode-plate-enter 400ms cubic-bezier(.2,.75,.3,1) both;
    --entry-transform: translateY(-13px) scale(1.055);
  }
  .v79-mode [data-rules=king-of-the-hill] .mode-plate {
    animation: mode-plate-enter 400ms 70ms cubic-bezier(.2,.75,.3,1) both;
    --entry-transform: translateY(10px) rotate(-4deg);
  }
  .v79-mode [data-rules=capture-the-flag] .mode-plate {
    animation: mode-plate-enter 400ms 140ms cubic-bezier(.2,.75,.3,1) both;
    --entry-transform: translateX(13px) skewX(-6deg);
  }
  .v79-mode [data-rules=spar] .mode-plate {
    animation: mode-plate-enter 400ms 210ms cubic-bezier(.2,.75,.3,1) both;
    --entry-transform: translateY(8px) scale(.87);
  }
}

@keyframes mode-plate-enter {
  from { opacity: 0; transform: var(--entry-transform); }
  68% { opacity: 1; transform: translateY(-2px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .v79-mode .mode-plate { transition: none; }
}

/* Keep the rail in the safe rectangle, even when the Christmas yard reaches past the 960×540 stage. */
#device .v79-mode .mode-layout {
  --mode-inset: max(18px, calc(14px / var(--ui-scale, 1)));
  position: absolute;
  top: calc(var(--match-top, 0px) + var(--mode-inset));
  left: calc(var(--match-left, 0px) + var(--mode-inset));
  width: calc(var(--match-width, 960px) - 2 * var(--mode-inset));
  height: calc(var(--match-height, 540px) - 2 * var(--mode-inset));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  pointer-events: none;
}

.v79-mode .mode-choices {
  grid-area: 2 / 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  pointer-events: auto;
}

.v79-mode .mode-sidebar {
  grid-area: 1 / 1;
  justify-self: end;
  align-self: start;
  max-height: 100%;
  width: max(194px, calc(107px / var(--ui-scale, 1)));
  --rail-edge: polygon(17px 0, calc(100% - 9px) 0, 100% 10px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 8px 100%, 0 calc(100% - 9px), 0 17px);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 4px 5px 7px;
  pointer-events: auto;
  filter: drop-shadow(0 3px 2px #0b1b4266);
}

.v79-mode .mode-sidebar::before,
.v79-mode .mode-sidebar::after {
  content: "";
  position: absolute;
  z-index: -1;
  clip-path: var(--rail-edge);
  pointer-events: none;
}

.v79-mode .mode-sidebar::before {
  inset: 0;
  background: linear-gradient(155deg, #b7f5ff, #35bafb 13%, #1a6cb5 39%, #12285a 74%, #0a1733);
}

.v79-mode .mode-sidebar::after {
  inset: 2px 2px 4px;
  background: linear-gradient(141deg, #264f86, #101f44 30%, #0a1937 80%, #112b53);
}

#device .v79-mode .mode-player {
  flex: none;
  display: grid;
  grid-template-columns: max(39px, calc(25px / var(--ui-scale, 1))) minmax(0, 1fr);
  align-items: center;
  align-content: center;
  gap: 7px;
  height: max(71px, calc(44px / var(--ui-scale, 1)));
  padding: 8px 11px 10px;
  font: 15px/1 Bungee, sans-serif;
  color: #202247;
  text-shadow: none;
  clip-path: polygon(13px 0, calc(100% - 7px) 0, 100% 8px, 100% 100%, 0 100%, 0 13px);
  background: linear-gradient(154deg, #fff1ad, #ffcf3e 47%, #efa81b 80%, #db850f);
  box-shadow: inset 0 2px #fff5c2, inset 0 -2px #ac6014;
}
.v79-mode .mode-player-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
  background: radial-gradient(ellipse at 50% 42%, #328ed8, #134789 70%, #093469);
}
.v79-mode .mode-player-avatar {
  position: absolute;
  width: 142%;
  height: 142%;
  inset: -21%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 1px 2px #072653b0);
}
.v79-mode .mode-player-main { min-width: 0; display: grid; gap: 4px; text-align: left; }
.v79-mode .mode-player-xp {
  width: 100%; height: 4px; appearance: none; border: 0; border-radius: 3px; overflow: hidden;
  background: #98601d; accent-color: #134c9a;
}
.v79-mode .mode-player-xp::-webkit-progress-bar { background: #98601d; }
.v79-mode .mode-player-xp::-webkit-progress-value { background: #134c9a; }
.v79-mode .mode-player-xp::-moz-progress-bar { background: #134c9a; }
#device .v79-mode .mode-player:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }

#device .v79-mode .mode-player strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: normal;
  text-shadow: 0 1px #fff4b9;
}

.v79-mode .mode-player-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.v79-mode .mode-player .level {
  flex: none;
  padding: 3px 7px;
  font-size: 12px;
  color: #124bb4;
  background: linear-gradient(#fffdf6, #fff1cd);
  clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

.v79-mode .mode-player .tickets {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #202247;
  text-shadow: 0 1px #fff2aa;
}

.v79-mode .mode-player .tickets b {
  font-size: clamp(9px, calc(116px / max(1, var(--balance-length, 1))), 25px);
}

.v79-mode .mode-player .tickets img {
  flex: none;
  height: 24px;
  width: auto;
  filter: drop-shadow(0 1px 1px #743a1780);
}

.v79-mode .mode-nav {
  flex: 0 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max(38px, calc(44px / var(--ui-scale, 1)));
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: #97d9ff #143364;
}

.v79-mode .mode-nav-hint {
  display: none;
  flex: none;
  width: 100%;
  min-height: 0;
  justify-content: center;
  align-items: center;
  gap: .45em;
  color: #d5edff;
  font: max(13px, calc(9px / var(--ui-scale, 1)))/1.25 Bungee, sans-serif;
  padding-block: .18em;
  white-space: nowrap;
}
.v79-mode .mode-nav-hint:not([hidden]) { display: flex; }
.v79-mode .mode-nav-hint::after { content: "↓"; font: bold 1.35em/1 system-ui, sans-serif; }

#device .v79-mode .mode-nav button {
  --plate-unit: .54px;
  --shine: #bceaff;
  --trim: #3aafff;
  --light: #168aff;
  --mid: #1459df;
  --low: #1735a0;
  --nav-icon-width: max(38px, calc(30px / var(--ui-scale, 1)));
  --nav-face-top: 2px;
  --nav-face-side: 3px;
  --nav-face-bottom: 4px;
  --pattern: linear-gradient(#fff, #fff) right center / var(--nav-icon-width) 100% no-repeat content-box,
    linear-gradient(180deg, #a5d8ff2b, transparent 42%);
  --plate-keyline: linear-gradient(90deg, var(--trim), transparent 51%, var(--shine))
    left var(--upper-left) bottom 1px / calc(100% - var(--nav-icon-width) - var(--upper-left)) 2px no-repeat content-box;
  z-index: 0;
  min-width: 0;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 calc(var(--nav-icon-width) + 10px) 3px 12px;
  color: #fffdf5;
  font: max(16px, calc(11.5px / var(--ui-scale, 1)))/1.02 Bungee, sans-serif;
  letter-spacing: .015em;
  text-align: left;
}

.v79-mode .mode-nav .menu-action::after {
  inset: var(--nav-face-top) var(--nav-face-side) var(--nav-face-bottom);
}
.v79-mode .mode-nav .menu-action:hover::after { filter: brightness(1.14); }
#device .v79-mode .mode-nav button:focus-visible { outline-offset: -3px; }

/* Align the icon with the white content-box section of the beveled face. */
.v79-mode .mode-nav-icon-box {
  position: absolute;
  top: calc(var(--nav-face-top) + var(--plate-rim-inset));
  right: calc(var(--nav-face-side) + var(--plate-rim-inset));
  bottom: calc(var(--nav-face-bottom) + var(--plate-base-inset));
  width: var(--nav-icon-width);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.v79-mode .mode-nav button:active .mode-nav-icon-box { translate: 0 2px; }

/* The label stays live while the six modeled emblems share one texture. */
.v79-mode .mode-nav-icon {
  flex: none;
  width: max(24px, calc(22px / var(--ui-scale, 1)));
  aspect-ratio: 1;
  background: url('./sidebar-emblems.webp') var(--sidebar-icon, left top) / 300% 200% no-repeat;
  filter: drop-shadow(0 1px 1px #31578c5c);
}
.v79-mode [data-go=shop] { --sidebar-icon: center top; }
.v79-mode [data-go=settings] { --sidebar-icon: right top; }
.v79-mode [data-go=stats] { --sidebar-icon: left bottom; }
.v79-mode [data-go=stuff] { --sidebar-icon: center bottom; }
.v79-mode [data-go=friends] { --sidebar-icon: right bottom; }

#device .v79-mode .mode-nav-label {
  min-width: 0;
  color: #f6fbff;
  text-shadow: 0 1px #2b579f, 0 2px #102454, 0 3px 2px #08162a8c;
}

