/* Pocket Ki Arcade — Luna implementation of Astra's menu direction. */
#screen-menu.arcade-menu {
  --arcade-bg: #080e20;
  --arcade-shell: #152440;
  --arcade-well: #0a1429;
  --arcade-ink: #f7faff;
  --arcade-muted: #bac9e5;
  --arcade-gold: #ffb52e;
  --arcade-gold-edge: #9e4c08;
  --arcade-cyan: #39d3ed;
  --arcade-cyan-edge: #12657d;
  --arcade-violet: #a895ff;
  --arcade-violet-edge: #514087;
  --arcade-coral: #ff9477;
  --arcade-coral-edge: #9e4434;
  --arcade-mint: #69dfc1;
  --arcade-mint-edge: #247865;
  background:
    radial-gradient(circle at 50% 6%, rgb(67 111 190 / .26), transparent 34%),
    linear-gradient(145deg, #050a18, var(--arcade-bg));
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 12px;
}

#screen-menu .arcade-console {
  width: min(100%, 820px);
  max-width: 820px;
  margin: 0 auto 18px;
  padding: 22px;
  color: var(--arcade-ink);
  background:
    linear-gradient(145deg, rgb(255 255 255 / .08), transparent 24%),
    linear-gradient(160deg, #1b3156, var(--arcade-shell) 52%, #0d1931);
  border: 1px solid rgb(173 211 255 / .35);
  border-radius: 26px;
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / .13),
    inset 0 -8px 24px rgb(0 0 0 / .25),
    0 12px 0 #071126,
    0 24px 42px rgb(0 0 0 / .5),
    0 0 36px rgb(52 127 255 / .16);
}

#screen-menu .title-banner {
  position: relative;
  margin-bottom: 16px;
  padding: 5px 10px 10px;
  text-align: left;
}

#screen-menu .title-banner::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--arcade-gold), transparent);
  box-shadow: 0 0 12px rgb(255 181 46 / .55);
}

#screen-menu .hero-text {
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 1px;
  color: #ffdf6b;
  text-shadow: 2px 3px 0 #6d2b0a, 0 0 18px rgb(255 181 46 / .45);
}

#screen-menu .sub-hero-text {
  position: relative;
  z-index: 1;
  font-size: clamp(2.5rem, 7vw, 3.8rem);
  color: #fff;
  text-shadow: 3px 4px 0 #243c71, 0 0 18px rgb(57 211 237 / .28);
}

#screen-menu .tagline {
  position: relative;
  z-index: 1;
  color: var(--arcade-muted);
  letter-spacing: .03em;
}

#screen-menu .menu-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

#screen-menu .arcade-key {
  --key-light: #ffe48a;
  --key-face: #ffb52e;
  --key-edge: var(--arcade-gold-edge);
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 78px;
  align-items: center;
  border: 1px solid rgb(255 255 255 / .3);
  border-radius: 16px;
  color: #281600;
  background: linear-gradient(180deg, var(--key-light), var(--key-face));
  box-shadow:
    inset 0 2px 0 rgb(255 255 255 / .36),
    inset 0 -4px 0 rgb(0 0 0 / .08),
    0 5px 0 var(--key-edge),
    0 10px 18px rgb(0 0 0 / .24);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

#screen-menu .arcade-key:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

#screen-menu .arcade-key:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .2),
    0 2px 0 var(--key-edge),
    0 5px 9px rgb(0 0 0 / .2);
}

#screen-menu .arcade-key:focus-visible,
#screen-menu .arcade-deck-trigger:focus-visible,
#screen-menu .deck-choice-btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

#screen-menu .arcade-key-cyan {
  --key-light: #b6f6ff;
  --key-face: var(--arcade-cyan);
  --key-edge: var(--arcade-cyan-edge);
  color: #063645;
}

#screen-menu .arcade-key-violet {
  --key-light: #e0d9ff;
  --key-face: var(--arcade-violet);
  --key-edge: var(--arcade-violet-edge);
  color: #21164c;
}

#screen-menu .arcade-key-coral {
  --key-light: #ffd1c5;
  --key-face: var(--arcade-coral);
  --key-edge: var(--arcade-coral-edge);
  color: #40170f;
}

#screen-menu .arcade-key-mint {
  --key-light: #c6ffe9;
  --key-face: var(--arcade-mint);
  --key-edge: var(--arcade-mint-edge);
  color: #073c31;
  grid-column: 1 / -1;
}

#screen-menu .arcade-key .btn-icon-large {
  flex: 0 0 auto;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: rgb(255 255 255 / .28);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), 0 2px 4px rgb(0 0 0 / .12);
  font-size: 1.75rem;
}

#screen-menu .arcade-key .btn-text {
  min-width: 0;
  padding: 0 8px;
  text-align: left;
}

#screen-menu .arcade-key .btn-main {
  display: block;
  font-size: clamp(.95rem, 2vw, 1.15rem);
  line-height: 1.12;
}

#screen-menu .arcade-key .btn-sub {
  display: block;
  margin-top: 4px;
  font-size: .76rem;
  line-height: 1.2;
  opacity: .8;
}

#screen-menu .menu-utility-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 0 10px;
}

#screen-menu .menu-profile-utility {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 13px;
  color: var(--arcade-ink);
  background: linear-gradient(180deg, #253d68, #172b4c);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .1), 0 3px 0 #071126;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

#screen-menu .menu-profile-utility:hover,
#screen-menu .menu-profile-utility:focus-visible {
  border-color: var(--arcade-gold);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .14), 0 0 14px rgb(255 181 46 / .2);
}

#screen-menu .menu-profile-thumb {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  object-fit: contain;
  border: 1px solid rgb(255 224 107 / .75);
  border-radius: 50%;
  background: #09142b;
}

#screen-menu .menu-profile-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

#screen-menu .menu-profile-copy strong {
  color: var(--arcade-gold);
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#screen-menu .menu-profile-copy span {
  overflow: hidden;
  color: var(--arcade-muted);
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#screen-menu .menu-profile-change {
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#screen-menu .arcade-deck-panel {
  padding: 9px;
  background: var(--arcade-well);
  border: 1px solid rgb(139 181 244 / .27);
  box-shadow: inset 0 3px 10px rgb(0 0 0 / .24);
}

#screen-menu .arcade-deck-trigger {
  display: grid;
  width: 100%;
  min-height: 48px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / .22);
  border-radius: 12px;
  color: var(--arcade-ink);
  background: linear-gradient(180deg, #253d68, #172b4c);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .12), 0 3px 0 #071126;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

#screen-menu .arcade-deck-trigger strong {
  overflow: hidden;
  color: var(--arcade-gold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#screen-menu .arcade-deck-sheet {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding-top: 2px;
}

#screen-menu .arcade-deck-sheet.hidden {
  display: none !important;
}

#screen-menu .arcade-deck-sheet .deck-choice-btn {
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid #3b5480;
  border-radius: 10px;
  color: var(--arcade-muted);
  background: #172b4c;
  cursor: pointer;
  font: 800 .8rem/1.1 Outfit, sans-serif;
}

#screen-menu .arcade-deck-sheet .deck-choice-btn.active {
  border-color: var(--arcade-gold);
  color: #271900;
  background: var(--arcade-gold);
  box-shadow: 0 3px 0 var(--arcade-gold-edge);
}

#screen-menu .mobile-wifi-info {
  margin-top: 8px;
  color: #91a8cc;
}

@media (max-width: 600px) {
  #screen-menu.arcade-menu {
    align-items: flex-start;
    overflow-y: auto;
    padding: max(7px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  }

  #screen-menu .arcade-console {
    width: 100%;
    padding: 11px;
    border-radius: 20px;
  }

  #screen-menu .title-banner {
    margin-bottom: 8px;
    padding: 0 4px 7px;
    text-align: center;
  }

  #screen-menu .title-banner::after {
    left: 0;
    right: 0;
  }

  #screen-menu .hero-text { font-size: 1.55rem; }
  #screen-menu .sub-hero-text { font-size: 2.15rem; }
  #screen-menu .tagline { font-size: .68rem; }

  #screen-menu .menu-actions {
    gap: 8px;
    margin-bottom: 10px;
  }

  #screen-menu .arcade-key {
    min-height: 64px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 7px 5px;
    border-radius: 13px;
  }

  #screen-menu .arcade-key .btn-icon-large {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 1.2rem;
  }

  #screen-menu .arcade-key .btn-text {
    padding: 0;
    text-align: center;
  }

  #screen-menu .arcade-key .btn-main {
    font-size: .75rem;
    line-height: 1.05;
  }

  #screen-menu .arcade-key .btn-sub { display: none; }

  #screen-menu .arcade-key-mint {
    grid-column: 1 / -1;
    min-height: 52px;
    flex-direction: row;
  }

  #screen-menu .arcade-key-mint .btn-text { text-align: left; }
  #screen-menu .arcade-key-mint .btn-icon-large { width: 34px; height: 34px; }

  #screen-menu .arcade-deck-panel { padding: 6px; }
  #screen-menu .arcade-deck-trigger { min-height: 44px; font-size: .82rem; }
  #screen-menu .arcade-deck-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #screen-menu .mobile-wifi-info { margin-top: 5px; font-size: .58rem; }
}

@media (max-width: 360px), (max-height: 620px) and (max-width: 600px) {
  #screen-menu .arcade-console { padding: 7px; }
  #screen-menu .title-banner { margin-bottom: 4px; }
  #screen-menu .hero-text { font-size: 1.3rem; }
  #screen-menu .sub-hero-text { font-size: 1.75rem; }
  #screen-menu .tagline { display: none; }
  #screen-menu .menu-actions { gap: 5px; margin-bottom: 6px; }
  #screen-menu .arcade-key { min-height: 52px; }
  #screen-menu .arcade-key .btn-icon-large { width: 24px; height: 24px; font-size: 1rem; }
  #screen-menu .arcade-key .btn-main { font-size: .68rem; }
  #screen-menu .arcade-key-mint { min-height: 44px; }
  #screen-menu .arcade-deck-trigger { min-height: 40px; }
  #screen-menu .mobile-wifi-info { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #screen-menu .arcade-key,
  #screen-menu .arcade-deck-trigger { transition: none; }
  #screen-menu .arcade-key:hover,
  #screen-menu .arcade-key:active { transform: none; }
}

.profile-selector-card {
  display: flex;
  flex-direction: column;
  width: min(620px, calc(100vw - 28px));
  max-height: min(600px, calc(100dvh - 28px));
  overflow: hidden;
  padding: 18px;
  text-align: left;
}

.profile-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.profile-selector-header h2 {
  color: #fff4b0;
  font: 800 clamp(1.15rem, 3vw, 1.55rem)/1.05 Outfit, sans-serif;
}

.profile-selector-header .btn-icon {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
}

.profile-selector-help {
  margin: 0 0 12px;
  color: #b9c8e7;
  font-size: .82rem;
  line-height: 1.35;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px;
}

.profile-choice {
  display: grid;
  grid-template-rows: 68px auto auto;
  align-content: start;
  min-height: 112px;
  min-width: 0;
  padding: 6px;
  border: 2px solid rgb(100 139 208 / .45);
  border-radius: 12px;
  background: linear-gradient(155deg, rgb(21 39 75 / .95), rgb(6 14 31 / .98));
  color: #fff;
  cursor: pointer;
  text-align: center;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.profile-choice:hover,
.profile-choice:focus-visible,
.profile-choice.active {
  border-color: #ffe06b;
  box-shadow: 0 0 14px rgb(255 218 92 / .3);
  transform: translateY(-2px);
}

.profile-choice img {
  display: block;
  width: 100%;
  height: 68px;
  object-fit: contain;
  border-radius: 8px;
  background: #09142b;
}

.profile-choice span,
.profile-choice small { display: block; min-width: 0; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-choice span { color: #fff4b0; font: 800 .78rem/1.05 Outfit, sans-serif; }
.profile-choice small { color: #8edcff; font-size: .64rem; }
.profile-avatar { overflow: hidden; padding: 0 !important; }
.profile-avatar img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 600px) {
  #screen-menu .menu-utility-row { margin-bottom: 8px; }
  #screen-menu .menu-profile-utility { min-height: 50px; padding: 7px 9px; }
  #screen-menu .menu-profile-thumb { width: 32px; height: 32px; flex-basis: 32px; }
  #screen-menu .menu-profile-copy span { font-size: .72rem; }
  #screen-menu .menu-profile-change { font-size: .68rem; }

  .profile-selector-card { width: min(440px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); padding: 14px; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .profile-choice { min-height: 124px; grid-template-rows: 72px auto auto; }
  .profile-choice img { height: 72px; }
}

@media (max-width: 360px) {
  #screen-menu .menu-profile-copy strong { font-size: .76rem; }
  #screen-menu .menu-profile-copy span { font-size: .68rem; }
  .profile-selector-header h2 { font-size: 1.05rem; }
  .profile-selector-help { font-size: .76rem; }
}

@media (prefers-reduced-motion: reduce) {
  .profile-choice { transition: none; }
}
