/* Controller start screen — account-aware game entry. */
.start-screen { overflow-y: auto; overscroll-behavior: contain; }

.start-choice {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(100%, 480px);
}
.start-choice-card {
  position: relative;
  min-height: 152px;
  padding: 15px 14px;
  border: 3px solid var(--paper);
  border-radius: 16px;
  box-shadow: 6px 6px 0 rgba(43, 36, 64, .2);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  appearance: none;
  font-family: var(--body);
}
.start-choice-card.join { background: var(--bg2); color: var(--paper); transform: rotate(-1deg); }
.start-choice-card.host { background: var(--red); color: #fff; transform: rotate(1deg); }
.start-choice-card:active { transform: translate(2px, 3px) rotate(0); box-shadow: 3px 3px 0 rgba(43, 36, 64, .2); }
.choice-num {
  position: absolute;
  top: 9px;
  right: 11px;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  opacity: .32;
}
.choice-kicker {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .14em;
}
.choice-title {
  display: block;
  margin: 10px 0 8px;
  font-family: var(--display);
  font-size: clamp(25px, 7vw, 35px);
  line-height: .88;
  letter-spacing: -.04em;
  text-transform: uppercase;
}
.choice-sub {
  display: block;
  max-width: 150px;
  font-size: 10px;
  line-height: 1.35;
  opacity: .72;
}
.start-choice-card.host .choice-sub { opacity: .85; }

.host-launch {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28, 26, 24, .82);
  backdrop-filter: blur(4px);
}
.host-launch-card {
  width: min(100%, 420px);
  padding: 22px;
  border: 3px solid var(--paper);
  border-radius: 18px;
  background: var(--bg2);
  color: var(--paper);
  box-shadow: 9px 9px 0 rgba(0, 0, 0, .28);
}
.host-launch-kicker { color: var(--red); font-family: var(--display); font-size: 10px; letter-spacing: .16em; }
.host-launch-title { margin: 6px 0 6px; font-family: var(--display); font-size: 43px; line-height: .88; letter-spacing: -.05em; text-transform: uppercase; }
.host-launch-sub { margin: 0 0 15px; color: var(--dim); font-size: 12px; line-height: 1.4; }
.host-launch-grid { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 2px solid var(--paper); border-radius: 10px; background: var(--bg3); }
.host-launch-label { display: block; color: var(--dim); font-size: 8px; letter-spacing: .14em; }
.host-launch-code { display: block; margin-top: 2px; font-family: var(--display); font-size: 38px; letter-spacing: .1em; line-height: 1; }
.host-launch-qr { width: 88px; height: 88px; padding: 3px; border-radius: 5px; background: #fff; image-rendering: pixelated; }
.host-launch-tv {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 10px;
  border: 2px solid var(--paper);
  border-radius: 9px;
  background: var(--gold);
  color: var(--paper);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .06em;
  text-decoration: none;
}
.host-launch-status { min-height: 18px; margin: 10px 0 4px; color: var(--dim); font-size: 10px; text-align: center; }
.host-launch-close { width: 100%; padding: 6px; border: 0; background: transparent; color: var(--dim); font-family: var(--display); font-size: 9px; letter-spacing: .1em; cursor: pointer; }

@media (max-width: 460px) {
  .start-choice { grid-template-columns: 1fr; }
  .start-choice-card { min-height: 112px; }
  .choice-title { font-size: 29px; }
}
.start-sky::after { display: none; }
.start-sky::before {
  content: "";
  position: absolute;
  width: 64vw;
  height: 64vw;
  max-width: 560px;
  max-height: 560px;
  right: -20vw;
  top: -18vw;
  border: 4px solid var(--red);
  border-radius: 50%;
  opacity: .35;
}
.start-token {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 5px 0 rgba(43,36,64,.16));
  animation: tokenFade .55s both;
}
.start-token svg { width: 100%; height: 100%; display: block; }
.start-token:nth-child(1) { transform: rotate(-7deg); animation-delay: .28s; }
.start-token:nth-child(2) { transform: translateY(-8px) rotate(2deg); animation-delay: .36s; }
.start-token:nth-child(3) { transform: translateY(-3px) rotate(-2deg); animation-delay: .44s; }
.start-token:nth-child(4) { transform: rotate(7deg); animation-delay: .52s; }
.start-host {
  position: relative;
  z-index: 4;
  width: min(100%, 420px);
  min-height: 44px;
  border: 2px solid var(--paper);
  border-radius: 10px;
  background: transparent;
  color: var(--paper);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .08em;
  cursor: pointer;
}
.start-host:hover { background: var(--paper); color: var(--bg); }
.start-host-panel {
  position: relative;
  z-index: 5;
  width: min(100%, 420px);
  padding: 12px;
  border: 2px solid var(--paper);
  border-radius: 10px;
  background: var(--bg2);
  color: var(--paper);
}
.host-panel-kicker { font-size: 9px; letter-spacing: .14em; color: var(--dim); }
.host-panel-code { font-family: var(--display); font-size: 34px; letter-spacing: .12em; margin: 3px 0 9px; }
.host-panel-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.host-panel-actions a {
  color: var(--bg);
  background: var(--gold);
  border: 2px solid var(--paper);
  border-radius: 6px;
  padding: 7px 9px;
  text-decoration: none;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: .06em;
}
.host-panel-actions a + a { background: var(--red); color: #fff; }
.start-account-link {
  position: absolute;
  top: calc(18px + var(--safe-top));
  right: 18px;
  z-index: 8;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: .08em;
  border: 2px solid var(--paper);
  border-radius: 7px;
  padding: 8px 10px;
  background: rgba(23, 26, 35, .72);
}
.start-account-link:hover { background: var(--red); border-color: var(--red); }
.start-account-badge {
  position: relative;
  z-index: 4;
  margin: 0 0 2px;
  padding: 7px 10px;
  border: 2px solid var(--paper);
  border-radius: 7px;
  background: var(--bg2);
  color: var(--paper);
  font-size: 11px;
}
.start-account-badge strong { font-family: var(--display); font-size: 12px; }
.start-account-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 2px solid var(--paper);
  border-radius: 7px;
  background: var(--bg3);
  color: var(--paper);
  font-size: 11px;
}
.start-account-hint strong { font-family: var(--display); }
#join-screen.join-open {
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: calc(66px + var(--safe-top));
}
#join-screen.join-open .start-account-link { position: fixed; }

.controller-start {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  min-height: 100dvh;
  height: auto;
  background: #f1dfb8;
  color: #1c1a18;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.controller-start::before {
  content: "";
  position: fixed;
  width: 64vw;
  height: 64vw;
  max-width: 620px;
  max-height: 620px;
  right: -22vw;
  top: -24vw;
  border: 3px solid #e5482f;
  border-radius: 50%;
  opacity: .22;
  pointer-events: none;
}
.controller-start::after {
  content: "";
  position: fixed;
  width: 34vw;
  height: 34vw;
  max-width: 340px;
  max-height: 340px;
  left: -14vw;
  bottom: -18vw;
  background: #1e4ed8;
  border-radius: 42px;
  opacity: .10;
  transform: rotate(18deg);
  pointer-events: none;
}
.controller-top {
  position: relative;
  z-index: 2;
  width: min(100% - 30px, 520px);
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #1c1a18;
}
.controller-brand {
  font-family: var(--display);
  font-size: 24px;
  line-height: .8;
  letter-spacing: -.06em;
  color: #1c1a18;
  text-decoration: none;
}
.controller-brand span { display: block; color: #e5482f; font-size: .48em; letter-spacing: .04em; margin-top: 5px; }
.controller-account {
  color: #1c1a18;
  text-decoration: none;
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: .08em;
  border-bottom: 2px solid #e5482f;
  padding: 6px 0;
}
.controller-start-main {
  position: relative;
  z-index: 2;
  width: min(100% - 30px, 520px);
  margin: 0 auto;
  padding: 34px 0 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.controller-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  color: #6e665a;
}
.controller-kicker span { width: 8px; height: 8px; border-radius: 50%; background: #e5482f; border: 2px solid #1c1a18; }
.controller-title {
  margin: 13px 0 7px;
  font-family: var(--display);
  font-size: clamp(52px, 16vw, 82px);
  line-height: .82;
  letter-spacing: -.075em;
  color: #1c1a18;
}
.controller-title span { display: block; color: #e5482f; font-size: .46em; letter-spacing: -.02em; margin-top: 9px; }
.controller-sub { margin: 0 0 18px; color: #5d554a; font-size: 14px; }
.account-badge {
  align-self: flex-start;
  margin: 0 0 13px;
  padding: 7px 10px;
  border: 2px solid #1c1a18;
  border-radius: 7px;
  background: #fff8e8;
  font-size: 11px;
  color: #1c1a18;
}
.account-badge strong { font-family: var(--display); font-size: 13px; }
.controller-play {
  min-height: 52px;
  border: 2px solid #1c1a18;
  border-radius: 8px;
  background: #e5482f;
  color: #fff;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: .06em;
  box-shadow: 5px 5px 0 #1c1a18;
  cursor: pointer;
}
.controller-play:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #1c1a18; }
.controller-join {
  margin-top: 4px;
  background: #fff8e8;
  border: 2px solid #1c1a18;
  border-radius: 10px;
  padding: 13px;
  box-shadow: 5px 5px 0 #1c1a18;
}
.controller-join .join-back {
  border: 0;
  background: transparent;
  color: #6e665a;
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: .08em;
  padding: 0 0 10px;
  cursor: pointer;
}
.controller-join .field { margin-bottom: 10px; }
.controller-join .field label { color: #5d554a; font-size: 10px; letter-spacing: .08em; }
.controller-join .field input {
  min-height: 42px;
  border: 2px solid #1c1a18;
  border-radius: 7px;
  background: #f1dfb8;
  color: #1c1a18;
  font-size: 15px;
}
.controller-join .field input:focus { outline: 2px solid #e5482f; outline-offset: 1px; }
.account-name-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #f1dfb8;
  border: 2px solid #1c1a18;
  border-radius: 7px;
  color: #1c1a18;
  font-size: 12px;
}
.account-name-hint strong { font-family: var(--display); }
.controller-join .avatar-editor {
  background: #f1dfb8;
  border: 2px solid #1c1a18;
  border-radius: 9px;
  padding: 8px;
  margin: 0 0 11px;
}
.controller-join .avatar-preview { background: #fff8e8; border-color: #1c1a18; }
.controller-join .avatar-label { color: #6e665a; }
.controller-join .avatar-tabs button,
.controller-join .avatar-options button { border-color: #1c1a18; background: #fff8e8; color: #1c1a18; }
.controller-join .avatar-tabs button.active { background: #1c1a18; color: #fff8e8; }
.controller-join .avatar-options button.active { border-color: #e5482f; background: #ffe1d6; }
.controller-join .avatar-guest-note {
  padding: 9px 10px;
  border: 2px dashed #1c1a18;
  border-radius: 7px;
  background: #fff8e8;
  color: #4a4338;
  font-size: 11px;
  line-height: 1.4;
}
.controller-join .btn-join { width: 100%; min-height: 46px; background: #1e4ed8; border: 2px solid #1c1a18; color: #fff; box-shadow: 4px 4px 0 #1c1a18; }
.controller-join .error { color: #c93724; font-size: 12px; margin: 9px 0 0; }
.controller-start .join-foot { color: #6e665a; font-size: 10px; line-height: 1.5; margin: 17px 0 0; }
.controller-start .start-build { position: static; right: auto; bottom: auto; color: #8d8170; font-family: var(--display); font-size: 8px; letter-spacing: .12em; margin-top: 18px; }
@media (min-width: 620px) {
  .controller-start-main { padding-top: 42px; }
  .controller-join { padding: 16px; }
}
