:root {
  color-scheme: light dark;
  --ios-bg: #f2f2f7;
  --ios-surface: rgba(255, 255, 255, 0.72);
  --ios-surface-solid: #fff;
  --ios-elevated: rgba(255, 255, 255, 0.9);
  --ios-label: #111114;
  --ios-secondary: #61616a;
  --ios-separator: rgba(60, 60, 67, 0.18);
  --ios-blue: #087fff;
  --ios-green: #24a148;
  --ios-red: #d92d45;
  --ios-orange: #ed7b16;
  --ios-shadow: 0 18px 50px rgba(20, 30, 50, 0.12);
  --ios-radius: 20px;
}
* {
  box-sizing: border-box;
}
body.apple-game {
  margin: 0;
  background:
    radial-gradient(
      circle at 8% 2%,
      rgba(10, 132, 255, 0.16),
      transparent 28rem
    ),
    radial-gradient(
      circle at 95% 20%,
      rgba(175, 82, 222, 0.12),
      transparent 30rem
    ),
    var(--ios-bg);
  color: var(--ios-label);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  min-height: 100vh;
}
.apple-game a {
  color: inherit;
}
.apple-game button,
.apple-game input,
.apple-game select,
.apple-game textarea {
  font: inherit;
}
.apple-game button {
  min-height: 44px;
}
.apple-game [hidden] {
  display: none !important;
}
.ios-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 68px;
  padding: max(10px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right)) 10px
    max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--ios-separator);
  background: color-mix(in srgb, var(--ios-bg) 75%, transparent);
  backdrop-filter: saturate(180%) blur(24px);
}
.ios-back {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--ios-surface);
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1.6rem;
  box-shadow: inset 0 0 0 1px var(--ios-separator);
}
.ios-topbar-title {
  min-width: 0;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 11px;
}
.ios-topbar-title img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.ios-topbar-title span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ios-topbar-title strong {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ios-topbar-title small {
  color: var(--ios-secondary);
  font-size: 0.72rem;
}
.ios-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(36, 161, 72, 0.12);
  color: var(--ios-green);
  font-size: 0.72rem;
  font-weight: 750;
}
.ios-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto 70px;
}
.ios-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 12px 4px 26px;
}
.ios-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--ios-blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ios-titlebar h1 {
  margin: 0;
  font-size: clamp(2.35rem, 7vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}
.ios-titlebar p {
  margin: 10px 0 0;
  color: var(--ios-secondary);
  font-size: 1rem;
}
.ios-segmented {
  display: flex;
  padding: 3px;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.14);
  box-shadow: inset 0 0 0 1px var(--ios-separator);
}
.ios-segmented button {
  min-width: 116px;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ios-secondary);
  font-weight: 700;
  cursor: pointer;
}
.ios-segmented button.active {
  background: var(--ios-elevated);
  color: var(--ios-label);
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.11);
}
.ios-window {
  overflow: hidden;
  border: 1px solid var(--ios-separator);
  border-radius: 26px;
  background: var(--ios-surface);
  backdrop-filter: saturate(165%) blur(24px);
  box-shadow: var(--ios-shadow);
}
.ios-toolbar {
  min-height: 56px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--ios-separator);
}
.traffic-lights {
  display: flex;
  gap: 7px;
  margin-right: 4px;
}
.traffic-lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}
.traffic-lights i:nth-child(1) {
  background: #ff5f57;
}
.traffic-lights i:nth-child(2) {
  background: #febc2e;
}
.traffic-lights i:nth-child(3) {
  background: #28c840;
}
.toolbar-title {
  font-weight: 750;
}
.toolbar-spacer {
  flex: 1;
}
.ios-content {
  padding: 22px;
}
.ios-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ios-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ios-group {
  padding: 20px;
  border: 1px solid var(--ios-separator);
  border-radius: var(--ios-radius);
  background: var(--ios-elevated);
}
.ios-group h2,
.ios-group h3 {
  margin: 0 0 6px;
  letter-spacing: -0.025em;
}
.ios-group p {
  margin: 0 0 18px;
  color: var(--ios-secondary);
}
.ios-label {
  display: block;
  margin: 15px 0 6px;
  color: var(--ios-secondary);
  font-size: 0.8rem;
  font-weight: 700;
}
.ios-input,
.ios-select,
.ios-textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--ios-separator);
  border-radius: 12px;
  outline: 0;
  background: rgba(118, 118, 128, 0.08);
  color: var(--ios-label);
}
.ios-textarea {
  min-height: 90px;
  padding-top: 12px;
  resize: vertical;
}
.ios-input:focus,
.ios-select:focus,
.ios-textarea:focus {
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ios-blue) 18%, transparent);
}
.ios-button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  background: var(--ios-blue);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}
.ios-button.secondary {
  background: rgba(118, 118, 128, 0.14);
  color: var(--ios-label);
  box-shadow: inset 0 0 0 1px var(--ios-separator);
}
.ios-button.danger {
  background: var(--ios-red);
}
.ios-button.green {
  background: var(--ios-green);
}
.ios-button:disabled {
  cursor: default;
  opacity: 0.45;
}
.ios-button.full {
  width: 100%;
  margin-top: 18px;
}
.ios-notice {
  margin: 0 0 16px;
  padding: 13px 15px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ios-blue) 12%, var(--ios-elevated));
  color: var(--ios-label);
  font-size: 0.9rem;
}
.ios-notice.error {
  background: color-mix(in srgb, var(--ios-red) 13%, var(--ios-elevated));
  color: var(--ios-red);
}
.ios-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.12);
  font-size: 0.75rem;
  font-weight: 700;
}
.ios-chip.blue {
  background: color-mix(in srgb, var(--ios-blue) 13%, transparent);
  color: var(--ios-blue);
}
.ios-scorebar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ios-score {
  min-width: 110px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(118, 118, 128, 0.1);
}
.ios-score span {
  display: block;
  color: var(--ios-secondary);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ios-score strong {
  font-size: 1.2rem;
}
.game-stage {
  min-height: 460px;
  padding: 20px;
}
.game-message {
  min-height: 24px;
  color: var(--ios-secondary);
  text-align: center;
}
.game-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.lobby-players {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.lobby-player {
  min-height: 48px;
  padding: 8px 10px 8px 13px;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.09);
  display: flex;
  align-items: center;
  gap: 10px;
}
.lobby-player strong {
  flex: 1;
}
.lobby-player small {
  color: var(--ios-secondary);
}
.lobby-code {
  font-size: clamp(2rem, 9vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.17em;
  text-align: center;
  color: var(--ios-blue);
}
.playing-card {
  position: relative;
  width: 76px;
  height: 108px;
  padding: 7px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 11px;
  background: #fff;
  color: #151515;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.13);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
}
.playing-card.red {
  color: #d5273c;
}
.playing-card button {
  all: unset;
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: inherit;
}
.playing-card.disabled {
  opacity: 0.48;
}
.card-corner {
  font-size: 1rem;
  font-weight: 800;
  line-height: 0.9;
}
.card-suit {
  align-self: center;
  font-size: 2rem;
}
.card-hand {
  min-height: 124px;
  padding: 10px 6px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(2px, 1vw, 8px);
  overflow-x: auto;
}
.card-hand .playing-card {
  flex: 0 0 auto;
}
.card-hand.compact .playing-card {
  margin-left: -24px;
}
.card-hand.compact .playing-card:first-child {
  margin-left: 0;
}
.table-felt {
  border-radius: 22px;
  background: radial-gradient(circle at center, #329567, #176044);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 18px 60px rgba(0, 0, 0, 0.12);
  color: #fff;
}
.domino-tile {
  width: 54px;
  height: 104px;
  padding: 5px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  background: #f8f7f2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
  display: grid;
  grid-template-rows: 1fr 1px 1fr;
  color: #111;
  cursor: pointer;
}
.domino-tile.horizontal {
  width: 104px;
  height: 54px;
  grid-template-columns: 1fr 1px 1fr;
  grid-template-rows: 1fr;
}
.domino-half {
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 800;
}
.domino-line {
  background: #555;
}
.domino-chain {
  min-height: 120px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}
.battle-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  width: 470px;
  max-width: 100%;
  aspect-ratio: 1;
  margin: auto;
}
.battle-cell {
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 5px;
  background: rgba(10, 132, 255, 0.18);
  color: var(--ios-label);
  font-weight: 800;
  cursor: pointer;
}
.battle-cell.ship {
  background: #77808d;
}
.battle-cell.hit {
  background: var(--ios-red);
  color: #fff;
}
.battle-cell.miss {
  background: rgba(118, 118, 128, 0.22);
  color: var(--ios-secondary);
}
.battle-cell.pending {
  outline: 3px solid var(--ios-orange);
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.topic-toggle {
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--ios-separator);
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.08);
  display: flex;
  align-items: center;
  gap: 9px;
}
.topic-toggle input {
  width: 20px;
  height: 20px;
}
.adedanha-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}
.adedanha-table th {
  text-align: left;
  color: var(--ios-secondary);
  font-size: 0.72rem;
}
.adedanha-table td {
  padding: 8px;
  background: rgba(118, 118, 128, 0.08);
}
.adedanha-table td:first-child {
  border-radius: 10px 0 0 10px;
  font-weight: 700;
}
.adedanha-table td:last-child {
  border-radius: 0 10px 10px 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ios-bg: #0d0d10;
    --ios-surface: rgba(38, 38, 43, 0.72);
    --ios-surface-solid: #1c1c1e;
    --ios-elevated: rgba(48, 48, 54, 0.9);
    --ios-label: #f5f5f7;
    --ios-secondary: #aaaab2;
    --ios-separator: rgba(255, 255, 255, 0.12);
    --ios-blue: #0a84ff;
    --ios-green: #32d74b;
    --ios-red: #ff453a;
    --ios-orange: #ff9f0a;
    --ios-shadow: 0 22px 65px rgba(0, 0, 0, 0.35);
  }
}
@media (max-width: 760px) {
  .ios-shell {
    width: min(100% - 20px, 1180px);
    margin-top: 18px;
  }
  .ios-titlebar {
    align-items: stretch;
    flex-direction: column;
  }
  .ios-titlebar h1 {
    font-size: 2.7rem;
  }
  .ios-segmented {
    width: 100%;
  }
  .ios-segmented button {
    min-width: 0;
    flex: 1;
  }
  .ios-grid,
  .ios-grid.three {
    grid-template-columns: 1fr;
  }
  .ios-content,
  .game-stage {
    padding: 12px;
  }
  .traffic-lights {
    display: none;
  }
  .ios-topbar {
    height: 62px;
  }
  .ios-group {
    padding: 16px;
  }
  .playing-card {
    width: 60px;
    height: 90px;
  }
  .card-hand {
    justify-content: flex-start;
  }
  .battle-grid {
    width: 100%;
    gap: 2px;
  }
  .battle-cell {
    border-radius: 3px;
  }
  .topic-grid {
    grid-template-columns: 1fr;
  }
  .adedanha-table {
    display: block;
    overflow-x: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
@media (forced-colors: active) {
  .ios-button,
  .battle-cell,
  .playing-card,
  .domino-tile {
    border: 1px solid ButtonText;
  }
}
.ad-panel {
  margin-top: 30px;
  text-align: center;
}
.room-code-input {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 800;
}
.letter-orb {
  width: clamp(90px, 18vw, 150px);
  aspect-ratio: 1;
  margin: 6px auto 18px;
  border-radius: 34%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--ios-blue), #5856d6);
  color: #fff;
  font-size: clamp(3.8rem, 12vw, 7rem);
  font-weight: 850;
  box-shadow: 0 18px 42px color-mix(in srgb, var(--ios-blue) 28%, transparent);
}
.result-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-cell span {
  flex: 1;
}
.mini-action {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--ios-separator);
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.1);
  color: var(--ios-label);
  font-weight: 800;
  cursor: pointer;
}
.mini-action.approved {
  background: color-mix(in srgb, var(--ios-green) 18%, transparent);
  color: var(--ios-green);
}
.mini-action.rejected {
  background: color-mix(in srgb, var(--ios-red) 16%, transparent);
  color: var(--ios-red);
}
.battle-board h3 {
  text-align: center;
}
.battle-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0;
  color: var(--ios-secondary);
  font-size: 0.78rem;
}
.battle-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border-radius: 3px;
  vertical-align: -2px;
}
.battle-legend .ship {
  background: #77808d;
}
.battle-legend .hit {
  background: var(--ios-red);
}
.battle-legend .miss {
  background: rgba(118, 118, 128, 0.35);
}
.developer-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 4px max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--ios-separator);
  text-align: center;
  color: var(--ios-secondary);
  font-size: 0.82rem;
}
.developer-footer a {
  color: var(--ios-blue);
  font-weight: 800;
  text-decoration: none;
}
