:root {
  --bg: #071016;
  --panel: rgba(8, 15, 22, 0.78);
  --panel-strong: rgba(8, 15, 22, 0.94);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f2f7ff;
  --muted: rgba(242, 247, 255, 0.68);
  --accent: #9cdbff;
  --accent-2: #ffe7a1;
  --danger: #ff9b8d;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: var(--app-width, 100%);
  height: var(--app-height, 100%);
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  position: fixed;
  inset: 0;
  width: var(--app-width, 100vw);
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100vh);
  background:
    radial-gradient(circle at 50% 40%, rgba(42, 126, 106, 0.28), transparent 42%),
    linear-gradient(135deg, #0d1821 0%, #061015 55%, #0d171f 100%);
  overflow: hidden;
  touch-action: none;
}

.arena-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #123d32;
}

#gameCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#gameCanvas.dragging {
  cursor: grabbing;
}

.loading-screen {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: calc(18px + var(--safe-top)) calc(18px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(18px + var(--safe-left));
  background:
    radial-gradient(circle at 50% 38%, rgba(156, 219, 255, 0.20), transparent 35%),
    linear-gradient(135deg, rgba(3, 8, 12, 0.96), rgba(6, 16, 21, 0.98));
  backdrop-filter: blur(8px);
  opacity: 1;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-card {
  width: min(360px, 100%);
  padding: 20px 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(8, 15, 22, 0.82);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.loading-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent);
  animation: loading-spin 800ms linear infinite;
}

.loading-card h1,
.loading-card p {
  margin: 0;
}

.loading-card h1 {
  font-size: clamp(22px, 5vw, 34px);
  letter-spacing: -0.05em;
}

.loading-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}


.game-hint {
  position: absolute;
  left: 50%;
  top: calc(12px + var(--safe-top));
  z-index: 8;
  width: min(620px, calc(100% - 28px));
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(4, 10, 14, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(3px);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.game-hint.visible {
  opacity: 0.48;
  transform: translateX(-50%) translateY(0);
}


.modal[hidden] {
  display: none;
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: calc(18px + var(--safe-top)) calc(18px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(18px + var(--safe-left));
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
}

.start-modal {
  z-index: 30;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
  place-items: start center;
  padding-top: calc(8vh + var(--safe-top));
}

.fullscreen-fallback {
  width: var(--app-width, 100vw);
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
  overflow: hidden;
}

html.force-landscape,
body.force-landscape {
  width: var(--app-width, 100vw);
  height: var(--app-height, 100dvh);
  min-height: var(--app-height, 100dvh);
  overflow: hidden;
}

.app.force-landscape {
  inset: auto auto auto auto;
  left: 0;
  top: calc(-1 * var(--app-width, 100vw));
  width: var(--app-height, 100vh);
  height: var(--app-width, 100vw);
  min-height: 0;
  transform: rotate(90deg);
  transform-origin: bottom left;
}

.app.force-landscape .modal {
  place-items: center;
  padding: calc(10px + var(--safe-top)) calc(10px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(10px + var(--safe-left));
}

.app.force-landscape .start-modal {
  place-items: center;
  padding-top: calc(10px + var(--safe-top));
}

.app.force-landscape .intro-card {
  max-height: calc(var(--app-width, 100vw) - 20px);
}

.modal-card {
  position: relative;
  width: min(780px, 100%);
  max-height: min(88dvh, 860px);
  overflow: auto;
  padding: 20px;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.intro-card,
.pause-card {
  width: min(680px, 100%);
}

.intro-card {
  text-align: center;
  padding: clamp(22px, 5vw, 38px);
}

.intro-card h1,
.intro-card p {
  margin: 0;
}

.intro-card h1 {
  font-size: clamp(30px, 7vw, 58px);
  letter-spacing: -0.07em;
}

.intro-card p {
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(15px, 2.6vw, 18px);
  line-height: 1.5;
}

.intro-card strong {
  color: var(--accent-2);
}

.settings-card {
  width: min(780px, 100%);
}

.leaderboard-card {
  width: min(640px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-head h1,
.modal-head p {
  margin: 0;
}

.modal-head h1 {
  font-size: clamp(22px, 4vw, 34px);
  letter-spacing: -0.05em;
}

.modal-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

code {
  color: var(--accent-2);
}

.icon-btn {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 26px;
  line-height: 1;
}

.score-panel {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.pause-score {
  margin-bottom: 12px;
}

.team-score,
.match-state {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.team-score span,
.match-state span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-score strong,
.match-state strong {
  font-size: 29px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.score-flag {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.team-score-home {
  justify-content: flex-start;
}

.team-score-away {
  justify-content: flex-end;
}

.match-state {
  justify-content: center;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.08);
  border-inline: 1px solid var(--line);
}

.match-state strong {
  color: var(--accent-2);
  min-width: 34px;
  text-align: center;
}

.status-text {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
}

.pause-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr 1fr;
  gap: 10px;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.settings-form h2 {
  margin: 4px 0 -4px;
  color: var(--text);
  font-size: 16px;
  letter-spacing: -0.02em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-wide {
  grid-column: 1 / -1;
}

.team-preview-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.team-preview-card {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.team-preview-card img,
.team-flag-chip img {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.team-preview-card small,
.team-preview-card span,
.team-gallery-box > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.team-preview-card strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 15px;
}

.team-preview-card span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-gallery-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--line);
}

.team-gallery {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.team-flag-chip {
  min-width: 86px;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.team-flag-chip span {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.team-gallery-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(2, 8, 12, 0.72);
  color: var(--text);
  outline: none;
}

select option {
  background: #071016;
  color: var(--text);
}

.range-setting {
  gap: 9px;
}

.setting-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.range-value {
  min-width: 68px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}

input[type='range']:focus {
  border-color: transparent;
  box-shadow: none;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid var(--line);
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.86);
  background: var(--accent);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
}

input[type='range']::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid var(--line);
}

input[type='range']::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.86);
  background: var(--accent);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
}

input:focus,
select:focus {
  border-color: rgba(156, 219, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(156, 219, 255, 0.12);
}

input[type='range']:focus {
  border-color: transparent;
  box-shadow: none;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.modal-actions.single {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.intro-actions {
  margin-top: 22px;
  grid-template-columns: 1fr 1fr;
}

.modal-actions button,
.pause-actions button {
  min-height: 46px;
  border-radius: 13px;
  padding: 0 16px;
  background: var(--accent);
  color: #061016;
  font-weight: 900;
}

.modal-actions .secondary,
.pause-actions .secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.pause-actions .danger {
  background: rgba(255, 155, 141, 0.16);
  color: var(--danger);
  border: 1px solid rgba(255, 155, 141, 0.34);
}

.leaderboard-list {
  display: grid;
  gap: 8px;
}

.leaderboard-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.leaderboard-rank {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-2);
  font-weight: 900;
}

.leaderboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.leaderboard-score {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

@media (max-width: 760px) {
  .modal {
    padding: calc(10px + var(--safe-top)) calc(10px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(10px + var(--safe-left));
    place-items: end center;
  }

  .start-modal {
    place-items: start center;
    padding-top: calc(12px + var(--safe-top));
    padding-bottom: calc(10px + var(--safe-bottom));
  }

  .modal-card {
    max-height: 92dvh;
    border-radius: 20px;
    padding: 16px;
  }

  .intro-card {
    max-height: 70dvh;
    padding: 14px 16px;
  }

  .intro-card h1 {
    font-size: clamp(20px, 7vw, 34px);
  }

  .intro-card p {
    font-size: 13px;
    line-height: 1.25;
  }

  .score-panel {
    grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
  }

  .team-score,
  .match-state {
    min-height: 48px;
    padding: 8px 9px;
    gap: 6px;
  }

  .team-score span,
  .match-state span {
    font-size: 10px;
  }

  .team-score strong,
  .match-state strong {
    font-size: 22px;
  }

  .match-state {
    min-width: 120px;
    display: grid;
    justify-items: center;
    gap: 1px;
  }

  .form-grid,
  .modal-actions,
  .intro-actions,
  .pause-actions {
    grid-template-columns: 1fr;
  }

  .leaderboard-row {
    grid-template-columns: 40px 1fr;
  }

  .leaderboard-score {
    grid-column: 2;
    white-space: normal;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .modal-card {
    max-height: 94dvh;
  }

  .start-modal {
    place-items: center;
  }

  .intro-card {
    text-align: left;
    max-height: 88dvh;
  }

  .pause-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.preset-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.preset-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preset-actions button {
  min-height: 44px;
  border-radius: 13px;
  padding: 0 14px;
  font-weight: 900;
}

.preset-actions .secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.preset-actions .danger {
  background: rgba(255, 155, 141, 0.16);
  color: var(--danger);
  border: 1px solid rgba(255, 155, 141, 0.34);
}

.preset-actions button:disabled,
.modal-actions button:disabled,
.pause-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .preset-panel,
  .preset-actions {
    grid-template-columns: 1fr;
  }
}

/* v11 compact menus */
.modal {
  padding: calc(10px + var(--safe-top)) calc(10px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(10px + var(--safe-left));
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(94dvh, 780px);
  padding: 14px;
  border-radius: 18px;
}

.settings-card {
  width: min(720px, 100%);
  --settings-scroll-gutter: clamp(48px, 7vw, 68px);
  padding-right: calc(14px + var(--settings-scroll-gutter));
  background:
    linear-gradient(to left, rgba(255, 255, 255, 0.045) 0, rgba(255, 255, 255, 0.045) var(--settings-scroll-gutter), transparent var(--settings-scroll-gutter), transparent 100%),
    var(--panel-strong);
}

.settings-card::after {
  content: '↕';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.26);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.pause-card {
  width: min(620px, 100%);
}

.leaderboard-card {
  width: min(560px, 100%);
}

.modal-head {
  gap: 8px;
  margin-bottom: 10px;
}

.icon-btn {
  width: 36px;
  height: 36px;
}

.score-panel {
  border-radius: 15px;
}

.pause-score {
  margin-bottom: 8px;
}

.team-score,
.match-state {
  min-height: 46px;
  padding: 7px 10px;
  gap: 7px;
}

.score-flag {
  width: 28px;
  height: 28px;
}

.status-text {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
}

.pause-actions {
  margin-top: 10px;
  gap: 7px;
}

.settings-form {
  gap: 10px;
}

.settings-form h2 {
  margin: 2px 0 -3px;
}

.form-grid {
  gap: 8px;
}

label {
  gap: 5px;
}

input,
select {
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 10px;
}

.range-setting {
  gap: 5px;
}

.range-value {
  padding: 3px 7px;
}

input[type='range'] {
  min-height: 28px;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 8px;
}

input[type='range']::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -8px;
}

input[type='range']::-moz-range-track {
  height: 8px;
}

input[type='range']::-moz-range-thumb {
  width: 20px;
  height: 20px;
}

.modal-actions,
.preset-actions {
  gap: 7px;
}

.modal-actions button,
.pause-actions button,
.preset-actions button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
}

.preset-panel {
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
}

.team-select-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.team-select-flag {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

@media (max-width: 760px) {
  .modal-card {
    max-height: 94dvh;
    padding: 12px;
  }

  .settings-card {
    --settings-scroll-gutter: clamp(50px, 14vw, 64px);
    padding-right: calc(12px + var(--settings-scroll-gutter));
  }

  .settings-card::after {
    right: 16px;
    font-size: 24px;
  }

  .intro-card {
    padding: 12px 14px;
  }

  .team-score,
  .match-state {
    min-height: 42px;
    padding: 6px 8px;
  }

  .score-flag {
    width: 24px;
    height: 24px;
  }

  .team-select-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 7px;
  }

  .team-select-flag {
    width: 34px;
    height: 34px;
  }
}

/* v12 login flow */
.player-login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.player-login-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.player-login-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.player-login-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.player-login-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 950;
}

.player-login-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.player-login-copy span.is-logged {
  color: var(--accent-2);
}

.player-login-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.player-login-actions button {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 10px;
  font-weight: 900;
  white-space: nowrap;
}

.player-login-actions .secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.player-login-actions .ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.login-card {
  width: min(460px, 100%);
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-availability {
  min-height: 36px;
  display: grid;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.login-availability.is-available {
  color: #b7ffd8;
  border-color: rgba(104, 255, 174, 0.32);
  background: rgba(30, 168, 95, 0.12);
}

.login-availability.is-existing {
  color: var(--accent-2);
  border-color: rgba(255, 231, 161, 0.32);
  background: rgba(255, 231, 161, 0.10);
}

.login-availability.is-error {
  color: var(--danger);
  border-color: rgba(255, 155, 141, 0.34);
  background: rgba(255, 155, 141, 0.10);
}

.login-availability.is-checking {
  color: var(--accent);
  border-color: rgba(156, 219, 255, 0.32);
}

@media (max-width: 760px) {
  .player-login-grid,
  .player-login-card {
    grid-template-columns: 1fr;
  }

  .player-login-actions {
    grid-template-columns: 1fr 1fr;
  }
}


@media (max-height: 430px) {
  .game-hint {
    top: calc(8px + var(--safe-top));
    width: min(560px, calc(100% - 20px));
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* v15 device preset flow */
.device-card {
  width: min(520px, 100%);
}

.device-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.device-actions button {
  min-height: 46px;
  border-radius: 13px;
  padding: 0 14px;
  background: var(--accent);
  color: #061016;
  font-weight: 950;
}

.preset-device-note {
  grid-column: 1 / -1;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 11px;
  background: rgba(156, 219, 255, 0.08);
  border: 1px solid rgba(156, 219, 255, 0.16);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.preset-device-note strong {
  color: var(--accent-2);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .device-actions {
    grid-template-columns: 1fr;
  }
}
