:root {
  font-family: Arial, sans-serif;
  color: #272627;
  background: #f8f6ef;
  font-synthesis: none;
  --accent: #f5b6cf;
  --dark: #272627;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
body[data-game='tic'] {
  --accent: #f7d96f;
}
body[data-game='crossword'] {
  --accent: #c6db9c;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #745bb5;
  outline-offset: 4px;
}
header {
  max-width: 1240px;
  margin: auto;
  padding: 27px 32px;
  display: flex;
  align-items: center;
  gap: 30px;
}
.brand {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1.2px;
}
.brand-mark {
  font-size: 36px;
  vertical-align: -3px;
  margin-right: 5px;
}
.back-link {
  font-size: 13px;
  color: #666;
}
.connection-badge {
  margin-left: auto;
  font-size: 12px;
  padding: 9px 13px;
  border: 1px solid #d9d6cd;
  border-radius: 30px;
}
.connection-badge.online {
  background: #e2edd6;
  border-color: #cedcbd;
}
.connection-badge.online:before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #658351;
  border-radius: 50%;
  margin-right: 7px;
}
main {
  max-width: 1120px;
  padding: 36px 30px 70px;
  margin: auto;
  min-height: 75vh;
}
.game-heading {
  margin-bottom: 32px;
}
.eyebrow,
.small-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.7px;
  font-weight: 600;
}
.game-heading h1 {
  font-family: Georgia, serif;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 400;
  letter-spacing: -2px;
  margin: 15px 0;
}
.game-heading > p {
  max-width: 590px;
  color: #6d6964;
  line-height: 1.6;
  font-size: 15px;
}
.paper,
.entry-card,
.invite-panel,
.result {
  border: 1px solid #e2dfd5;
  border-radius: 24px;
  background: #fffef9;
  padding: 30px;
}
h2 {
  font:
    400 29px/1.16 Georgia,
    serif;
  letter-spacing: -0.7px;
  margin: 12px 0 18px;
}
p {
  line-height: 1.6;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 9px;
}
input {
  min-width: 0;
  max-width: 100%;
  border: 1px solid #d8d3c9;
  border-radius: 10px;
  padding: 14px;
  background: #fffefc;
  color: #272627;
}
form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
form label {
  margin: 12px 0 0;
}
.primary,
.secondary {
  border: 0;
  border-radius: 30px;
  padding: 14px 23px;
  font-size: 13px;
  font-weight: 600;
  min-height: 46px;
}
.primary {
  color: #fff;
  background: #292929;
}
.primary span {
  margin-left: 30px;
}
.secondary {
  background: #eeeae1;
  color: #333;
}
.entry-card {
  max-width: 520px;
  margin: 45px auto;
  background: var(--accent);
  padding: 38px;
}
.entry-card h2 {
  font-size: 35px;
}
.entry-card p {
  font-size: 14px;
}
.entry-card .primary {
  margin-top: 6px;
}
.error {
  color: #9c3039;
  background: #fbe7e6;
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
}
.error:empty {
  display: none;
}
.players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.player {
  padding: 16px 20px;
  border: 1px solid #dedbd1;
  border-radius: 17px;
  display: flex;
  gap: 13px;
  align-items: center;
}
.player.is-self {
  background: var(--accent);
  border-color: transparent;
}
.avatar {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff94;
  font: 21px Georgia;
}
.player strong {
  font-size: 14px;
}
.player small {
  font-weight: 400;
  font-size: 11px;
  color: #555;
}
.presence {
  display: block;
  font-size: 11px;
  margin-top: 5px;
  color: #665f60;
}
.score {
  margin-left: auto;
  font: 29px Georgia;
}
.invite-panel {
  margin-top: 26px;
  display: flex;
  gap: 30px;
  align-items: center;
  background: transparent;
}
.invite-panel p {
  font-size: 12px;
  color: #777;
  margin: 7px 0 0;
}
.share-line {
  display: flex;
  gap: 8px;
  flex: 1;
}
.share-line input {
  font-size: 12px;
  flex: 1;
  width: 170px;
}
.share-line button {
  white-space: nowrap;
}
.waiting {
  text-align: center;
  padding: 55px 25px;
}
.waiting p {
  max-width: 460px;
  margin: 0 auto;
  color: #777;
  font-size: 14px;
}
.waiting-symbol {
  background: var(--accent);
  border-radius: 50%;
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  font: 36px Georgia;
}
.waiting h2 {
  font-size: 34px;
}
.secret-panel {
  max-width: 590px;
  margin: 0 auto;
  text-align: center;
}
.secret-panel form {
  max-width: 340px;
  margin: 0 auto;
  text-align: left;
}
.secret-panel p {
  color: #777;
  font-size: 14px;
}
.secret-panel input {
  text-transform: uppercase;
  letter-spacing: 3px;
}
.secret-panel input::placeholder {
  text-transform: none;
  letter-spacing: 0;
}
.secret-word {
  font: 30px Georgia;
  letter-spacing: 9px;
  padding: 20px;
}
.ready-label {
  display: inline-block;
  margin-top: 22px;
  font-size: 12px;
  background: #eeeae1;
  border-radius: 30px;
  padding: 10px 16px;
}
.wordle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.panel-head h2 {
  margin: 0;
  font-size: 25px;
}
.panel-head > span {
  font-size: 11px;
  color: #777;
  white-space: nowrap;
}
.word-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  max-width: 300px;
  margin: 0 auto;
}
.letter {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #dedbd2;
  border-radius: 7px;
  font-size: 25px;
  font-weight: 600;
  background: #faf9f4;
}
.letter.typed {
  border-color: #766680;
  background: #f1eaf9;
}
.correct {
  background: #8fae77 !important;
  color: #fff;
  border-color: transparent !important;
}
.present {
  background: #d7b458 !important;
  color: #fff;
  border-color: transparent !important;
}
.absent {
  background: #8d9194 !important;
  color: #fff;
  border-color: transparent !important;
}
.board-help {
  font-size: 11px;
  color: #837d75;
  line-height: 1.6;
  text-align: center;
  margin: 20px 0;
}
.keyboard {
  margin: 24px -12px 0;
}
.keyboard > div {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 5px;
}
.keyboard button {
  border: 0;
  border-radius: 5px;
  min-width: 0;
  flex: 1;
  max-width: 44px;
  padding: 0 2px;
  height: 43px;
  background: #eae6df;
  font-size: 12px;
  font-weight: 600;
  color: #383638;
}
.keyboard .wide {
  font-size: 10px;
  flex: 1.5;
  max-width: 60px;
}
.legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 10px;
  color: #777;
  margin-top: 22px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}
.opponent-panel {
  background: var(--accent);
  border-color: transparent;
  align-self: start;
}
.opponent-panel .small-label {
  font-size: 9px;
  letter-spacing: 1px;
}
.opponent-panel h2 {
  font-size: 30px;
}
.opponent-panel p {
  font-size: 12px;
  color: #5a4d53;
}
.mini-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  width: 170px;
  margin: 25px 0;
}
.mini-board i {
  aspect-ratio: 1;
  background: #ffffff80;
  border: 1px solid #ffffff80;
  border-radius: 4px;
}
.timer {
  font: 42px Georgia;
  letter-spacing: -2px;
  margin-top: 25px;
}
.result {
  background: var(--accent);
  border-color: transparent;
  margin-bottom: 22px;
}
.result h2 {
  font-size: 34px;
  margin-top: 0;
}
.result p {
  font-size: 14px;
}
.tic-panel {
  max-width: 650px;
  margin: auto;
}
.tic-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  max-width: 360px;
  margin: 30px auto;
}
.tic-board button {
  aspect-ratio: 1;
  border: 0;
  border-radius: 16px;
  background: #f1ede4;
  font: 75px/1 Arial;
  color: #343232;
}
.tic-board button:disabled {
  opacity: 1;
}
.tic-board .cross {
  color: #8d597a;
}
.tic-board .circle {
  color: #739072;
}
.tic-board .winning {
  background: var(--accent);
  box-shadow: inset 0 0 0 2px #c2a648;
}
.cross-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(230px, 1fr);
  gap: 22px;
}
.crossword-panel {
  padding: 26px;
}
.crossword-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 3px;
  max-width: 490px;
  margin: 26px auto;
}
.cross-cell {
  position: relative;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid #dad7cc;
  border-radius: 4px;
}
.cross-cell.in-word {
  background: #eef3df;
}
.cross-cell.selected {
  border: 2px solid #728d4b;
}
.cross-cell.partner-focus {
  box-shadow: 0 0 0 2px #a17bc3;
  z-index: 1;
}
.cross-cell.wrong {
  background: #f9d8d5;
}
.cross-cell.correct {
  background: #dbe9c9 !important;
  color: #272627;
}
.cross-cell > span {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 8px;
  pointer-events: none;
  z-index: 1;
}
.cross-cell input {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 3px;
  padding: 8px 0 0;
  text-align: center;
  background: transparent;
  font-size: clamp(16px, 2.3vw, 25px);
  font-weight: 600;
  outline: none;
  caret-color: #687e47;
}
.cross-cell input:focus-visible {
  outline: none;
}
.blocked {
  aspect-ratio: 1;
}
.clues h2 {
  font-size: 24px;
  margin-top: 25px;
}
.clue {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: #555;
}
.clue > b {
  font: 20px Georgia;
  color: #333;
}
.clue small {
  display: inline-block;
  color: #8d887d;
  font-size: 10px;
}
.clue.active {
  background: #eaf0dd;
}
.cross-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.cross-actions .board-help {
  text-align: right;
  margin: 0;
  font-size: 10px;
}
.active-clue {
  background: #eef2e5;
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
  margin: 22px 0 0;
}
.active-clue b {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.connection-note {
  padding: 15px;
  border-radius: 12px;
  background: #f7e8ca;
  margin-bottom: 20px;
  font-size: 13px;
}
.connection-note button {
  border: 0;
  background: none;
  text-decoration: underline;
  font-weight: 600;
}
footer {
  max-width: 1120px;
  margin: auto;
  padding: 25px 30px 35px;
  border-top: 1px solid #e0ddd3;
  display: flex;
  justify-content: space-between;
  color: #8c867d;
  font-size: 11px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 760px) {
  header {
    padding: 20px;
    gap: 16px;
  }
  .brand {
    font-size: 22px;
  }
  .brand-mark {
    font-size: 29px;
  }
  .back-link {
    display: none;
  }
  main {
    padding: 22px 18px 45px;
  }
  .game-heading h1 {
    letter-spacing: -1px;
  }
  .wordle-layout,
  .cross-layout {
    grid-template-columns: 1fr;
  }
  .opponent-panel {
    display: grid;
    grid-template-columns: 1fr 130px;
    column-gap: 15px;
    padding: 24px;
  }
  .opponent-panel .mini-board {
    grid-column: 2;
    grid-row: 1/5;
    width: 130px;
    margin: 0;
  }
  .opponent-panel h2 {
    margin: 10px 0;
  }
  .opponent-panel p {
    margin: 0;
  }
  .opponent-panel .timer {
    font-size: 30px;
    margin: 12px 0;
  }
  .invite-panel {
    flex-direction: column;
    align-items: stretch;
    padding: 22px;
    gap: 16px;
  }
  .share-line input {
    width: 0;
  }
  .players {
    gap: 9px;
  }
  .player {
    padding: 12px 10px;
    gap: 8px;
  }
  .avatar {
    width: 28px;
    height: 28px;
    font-size: 16px;
    flex-shrink: 0;
  }
  .player strong {
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  .player small {
    display: block;
    font-size: 9px;
  }
  .score {
    font-size: 23px;
  }
  .presence {
    font-size: 10px;
  }
  .paper {
    padding: 22px;
  }
  .word-board {
    max-width: 285px;
  }
  .word-panel {
    padding: 23px 20px;
  }
  .keyboard {
    margin-left: -10px;
    margin-right: -10px;
  }
  .keyboard button {
    height: 44px;
    font-size: 11px;
  }
  .entry-card {
    padding: 27px;
    margin: 25px auto;
  }
  .panel-head h2 {
    font-size: 22px;
  }
  .panel-head {
    align-items: flex-start;
  }
  .crossword-panel {
    padding: 18px 12px;
  }
  .crossword-grid {
    gap: 2px;
  }
  .cross-cell > span {
    font-size: 7px;
    top: 1px;
    left: 2px;
  }
  .cross-cell input {
    font-size: 20px;
    padding-top: 6px;
  }
  .cross-actions {
    gap: 12px;
  }
  .cross-actions button {
    padding: 12px 15px;
    font-size: 11px;
    white-space: nowrap;
  }
  .clues {
    padding: 25px;
  }
  .waiting h2 {
    font-size: 29px;
  }
  .tic-board button {
    font-size: 66px;
  }
  .result h2 {
    font-size: 30px;
  }
  .legend {
    gap: 8px;
    font-size: 9px;
  }
  footer {
    padding: 20px;
    gap: 20px;
    font-size: 10px;
  }
  .game-heading > p {
    font-size: 14px;
  }
  .connection-badge {
    font-size: 10px;
    padding: 8px 11px;
  }
  .secret-panel {
    padding: 28px 22px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  a {
    transition:
      background 0.15s,
      transform 0.15s;
  }
  button:active:not(:disabled) {
    transform: scale(0.97);
  }
}
/* Keep the opponent's live progress visible before the keyboard on phones. */
@media (max-width: 760px) {
  .wordle-layout {
    display: flex;
    flex-direction: column;
  }
  .opponent-panel {
    order: -1;
    width: 100%;
    grid-template-columns: 1fr 115px;
    padding: 18px 22px;
  }
  .opponent-panel .mini-board {
    width: 115px;
    grid-row: 1/6;
  }
  .opponent-panel h2 {
    font-size: 23px;
  }
  .opponent-panel .timer {
    font-size: 24px;
    margin: 6px 0;
  }
  .opponent-panel p {
    font-size: 10px;
  }
  .opponent-panel .small-label {
    font-size: 8px;
  }
  .brand {
    font-family: Georgia, serif;
  }
  .back-link {
    display: block;
    margin-left: auto;
    font-size: 10px;
  }
  .connection-badge {
    margin-left: 0;
  }
  .crossword-grid {
    margin-bottom: 12px;
  }
}
body[data-game='fleet'] {
  --accent: #bcdce7;
}
body[data-game='four'] {
  --accent: #e8c4a9;
}
body[data-game='memory'] {
  --accent: #cbbbe4;
}
body[data-game='code'] {
  --accent: #f0d7a0;
}
.four-panel,
.memory-panel {
  max-width: 690px;
  margin: auto;
}
.drop-controls {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin: 25px 8px 10px;
}
.drop-controls button {
  border: 0;
  border-radius: 9px;
  background: #eee7df;
  font-size: 23px;
  min-height: 44px;
}
.four-board {
  background: #e4d5ef;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  border-radius: 20px;
  box-shadow: 0 8px 0 #c3aed3;
}
.four-cell {
  aspect-ratio: 1;
  background: #fffdf7;
  border-radius: 50%;
  box-shadow: inset 0 3px 4px #33204014;
}
.four-cell.seat-0 {
  background: #cd786c;
  box-shadow: inset 0 -4px #b9635a;
}
.four-cell.seat-1 {
  background: #8770a8;
  box-shadow: inset 0 -4px #6b578b;
}
.four-cell.winning {
  outline: 3px solid #fff9e1;
  outline-offset: -6px;
}
.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.memory-card {
  aspect-ratio: 1;
  border: 0;
  border-radius: 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #e9e1f1;
  color: #67547e;
  box-shadow: 0 4px 0 #d4c7e2;
}
.memory-card:disabled {
  opacity: 1;
}
.memory-card.face-up {
  background: #f8eed6;
  box-shadow: 0 4px 0 #e2d8bd;
  color: #555044;
}
.memory-card.matched {
  background: #dfebcf;
  box-shadow: 0 4px 0 #c8d9b5;
  color: #5e744a;
}
.card-rings {
  font: 42px Georgia;
}
.memory-card strong {
  font-size: 12px;
  letter-spacing: 2px;
}
.memory-symbol {
  display: block;
  width: 28px;
  height: 28px;
  border: 3px solid currentColor;
  border-radius: 50%;
}
.symbol-0 {
  border-radius: 4px;
  transform: rotate(45deg);
}
.symbol-1 {
  border-radius: 3px 3px 12px 12px;
  border-top: 0;
}
.symbol-2 {
  width: 38px;
  height: 18px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  transform: rotate(-10deg);
}
.symbol-3 {
  border-top: 0;
  border-right: 0;
  transform: rotate(-30deg);
}
.symbol-4 {
  border-radius: 0;
  transform: rotate(45deg);
  width: 22px;
  height: 22px;
}
.symbol-5 {
  border-radius: 5px;
  border-style: dashed;
}
.symbol-6 {
  border-radius: 4px 4px 14px 14px;
  border-top-width: 7px;
}
.symbol-7 {
  border-radius: 50% 0 50% 0;
  transform: rotate(-15deg);
}
.memory-next {
  text-align: center;
  margin-top: 26px;
}
.memory-next p {
  font-size: 13px;
}
.fleet-boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.fleet-boards h3 {
  font: 24px Georgia;
  font-weight: 400;
  margin: 18px 0;
}
.sea-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  max-width: 360px;
  margin: auto;
  padding: 12px;
  background: #e0eff3;
  border-radius: 16px;
}
.sea-cell {
  aspect-ratio: 1;
  border: 1px solid #a9c9d9;
  border-radius: 6px;
  background: #f4fafb;
  font-size: 30px;
  line-height: 1;
  color: #577c90;
  padding: 0;
}
.sea-cell:disabled {
  opacity: 1;
  cursor: default;
}
.sea-cell.ship {
  background: #96aeb3;
  border-color: #829ca3;
}
.sea-cell.hit {
  background: #eac3ac;
  color: #ac6557;
  border-color: #d8a085;
}
.sea-cell.miss {
  background: #cfe2eb;
  color: #71909d;
}
.sea-cell.sunk {
  background: #bf8071;
  color: #fff;
}
.fleet-setup {
  max-width: 350px;
  margin: 25px auto;
}
.fleet-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.code-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 1fr;
  gap: 22px;
}
.code-input {
  display: flex;
  gap: 10px;
}
.code-input input {
  width: 0;
  flex: 1;
  letter-spacing: 6px;
  font-size: 20px;
}
.code-history {
  min-height: 120px;
  margin: 25px 0;
}
.code-row {
  display: flex;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid #ebe6d9;
  padding: 13px 3px;
  font-size: 13px;
}
.code-row > span {
  font-size: 10px;
  color: #969080;
}
.code-row strong {
  font-size: 23px;
  letter-spacing: 8px;
  margin-right: auto;
  font-weight: 500;
}
.code-row b,
.code-row i {
  padding: 6px 9px;
  background: #dfebd0;
  border-radius: 7px;
  white-space: nowrap;
  font-size: 11px;
  font-style: normal;
}
.code-row i {
  background: #f4e6ba;
}
.code-progress {
  background: #f0d7a0;
  align-self: start;
}
.code-progress h2 {
  font-size: 45px;
  margin: 25px 0;
}
.code-progress p {
  font-size: 13px;
}
.code-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 25px;
}
.code-dots i {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff8;
}
.code-dots .used {
  background: #a7844b;
}
@media (max-width: 760px) {
  .four-board {
    gap: 5px;
    padding: 9px;
    border-radius: 13px;
  }
  .drop-controls {
    gap: 4px;
    margin-left: 4px;
    margin-right: 4px;
  }
  .memory-board {
    gap: 9px;
  }
  .memory-card {
    border-radius: 11px;
    gap: 8px;
  }
  .memory-card strong {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .memory-symbol {
    width: 22px;
    height: 22px;
    border-width: 2px;
  }
  .card-rings {
    font-size: 32px;
  }
  .fleet-boards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .fleet-boards > div:last-child {
    max-width: 270px;
    width: 100%;
    margin: auto;
  }
  .fleet-boards h3 {
    font-size: 21px;
  }
  .sea-grid {
    gap: 4px;
    padding: 10px;
  }
  .sea-cell {
    min-height: 0;
    font-size: 27px;
  }
  .code-layout {
    grid-template-columns: 1fr;
  }
  .code-progress {
    padding: 22px;
    order: -1;
  }
  .code-progress h2 {
    display: inline-block;
    font-size: 30px;
    margin: 13px 0;
  }
  .code-progress p {
    font-size: 11px;
    margin: 0;
  }
  .code-dots {
    margin-top: 15px;
  }
  .code-input {
    gap: 7px;
  }
  .code-input .primary {
    padding: 12px 16px;
    font-size: 11px;
  }
  .code-row {
    gap: 9px;
  }
  .code-row strong {
    letter-spacing: 6px;
  }
  .four-cell.winning {
    outline-width: 2px;
    outline-offset: -4px;
  }
}
button,
a,
input {
  touch-action: manipulation;
}
input,
select,
textarea {
  font-size: 16px;
}
.keyboard,
.keyboard button {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.keyboard button:active:not(:disabled) {
  transform: none;
  background: #cec4db;
}
.drop-controls button {
  font-size: 11px;
  font-weight: 600;
}
@media (max-width: 760px) {
  body[data-game='wordle'][data-phase='playing'] {
    padding-bottom: 225px;
  }
  .keyboard {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 8px calc(12px + env(safe-area-inset-bottom));
    background: #f8f6ef;
    border-top: 1px solid #ded9cf;
    box-shadow: 0 -8px 24px #51466012;
    contain: layout;
    isolation: isolate;
  }
  .keyboard > div {
    gap: 3px;
    margin-top: 5px;
  }
  .keyboard button {
    height: 53px;
    max-width: none;
    font-size: 16px;
    border-radius: 6px;
  }
  .keyboard .wide {
    font-size: 12px;
    max-width: 60px;
  }
  .word-panel .legend {
    margin-top: 18px;
  }
  body[data-game='wordle']:not([data-phase='playing']) .keyboard {
    display: none;
  }
}
/* Fleet charts stay front-facing for precise touch placement; the pieces have depth. */
.fleet-panel {
  padding: 30px;
}
.fleet-planning {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(230px, 1fr);
  gap: 32px;
  margin-top: 24px;
}
.fleet-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.fleet-tools > span {
  font-size: 11px;
  color: #7b817d;
  white-space: nowrap;
}
.sea-chart {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px;
  max-width: 510px;
  margin: auto;
}
.sea-numbers {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  font-size: 10px;
  color: #81949b;
  text-align: center;
  padding-bottom: 3px;
}
.sea-letters {
  display: grid;
  grid-template-rows: repeat(10, 1fr);
  font-size: 10px;
  color: #81949b;
  align-items: center;
}
.sea-grid {
  display: grid;
  position: relative;
  grid-template-columns: repeat(var(--size), minmax(0, 1fr));
  gap: 0;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  border: 8px solid #c8dfe4;
  border-radius: 9px;
  background: #c8dfe4;
  box-shadow:
    0 5px 0 #9dbfc9,
    0 10px 24px #46697813;
}
.sea-cell {
  margin: 1px;
  aspect-ratio: 1;
  border: 1px solid #c0d9df;
  border-radius: 2px;
  background: linear-gradient(145deg, #f2fafb, #e2f0f4);
  padding: 0;
  font-size: 22px;
  position: relative;
  min-width: 0;
  min-height: 0;
}
.sea-cell.selected-ship {
  background: #dce6d2;
  border-color: #a3b58c;
}
.sea-cell:focus-visible {
  outline-offset: 0;
  outline-width: 2px;
  z-index: 5;
}
.ship-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.board-ship {
  position: absolute;
  pointer-events: none;
  padding: 2px;
  filter: drop-shadow(1px 4px 1px #3c5d6624);
}
.ship-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.board-ship.is-selected {
  filter: drop-shadow(0 0 3px #738c45);
}
.shot-mark {
  position: relative;
  z-index: 3;
  pointer-events: none;
  font-weight: 700;
  line-height: 1;
}
.hit .shot-mark {
  color: #a64f3f;
}
.sea-cell.hit {
  background: #efd9c8;
}
.sea-cell.sunk {
  background: #e7caba;
}
.sea-cell.miss {
  background: #d0e5ed;
}
.sea-cell.miss .shot-mark {
  font-size: 27px;
  color: #7897a4;
}
.dock-ships {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 14px 0 20px;
}
.dock-ship {
  border: 1px solid #e3e2d6;
  border-radius: 10px;
  background: #f8f7f0;
  padding: 9px;
  text-align: left;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dock-ship.on {
  border-color: #7e9d91;
  background: #e9efe0;
  box-shadow: 0 0 0 1px #8aa494;
}
.dock-art {
  display: block;
  height: 30px;
  width: 100%;
  max-width: 120px;
}
.dock-ship > span:nth-child(2) {
  font-size: 11px;
  font-weight: 600;
}
.dock-ship small {
  font-size: 9px;
  font-weight: 400;
  color: #888;
  display: block;
  margin-top: 3px;
}
.dock-ship b {
  font-size: 9px;
  color: #8e958d;
  font-weight: 400;
}
.dock-ship.placed b {
  color: #688057;
}
.ship-dock .fleet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.ship-dock .fleet-actions button {
  font-size: 10px;
  padding: 11px 9px;
  min-height: 42px;
}
.ship-dock .fleet-actions .primary {
  grid-column: 1/-1;
}
.fleet-boards {
  gap: 30px;
}
.fleet-boards h3 {
  margin-bottom: 20px;
}
.fleet-setup {
  max-width: none;
}
.fleet-boards > .board-help {
  font-size: 10px;
}
@media (max-width: 760px) {
  .fleet-panel {
    padding: 22px 13px;
  }
  .fleet-planning {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .fleet-tools .secondary {
    padding: 11px 13px;
    font-size: 11px;
  }
  .sea-chart {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 2px;
  }
  .sea-grid {
    border-width: 5px;
    border-radius: 6px;
  }
  .sea-cell {
    margin: 0.5px;
    font-size: 19px;
  }
  .sea-numbers,
  .sea-letters {
    font-size: 9px;
  }
  .fleet-boards > div:last-child {
    max-width: 360px;
  }
  .ship-dock {
    padding: 0 8px;
  }
  .dock-ships {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dock-ship {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 9px;
  }
  .dock-art {
    width: 52px;
    height: 24px;
  }
  .dock-ship > span:nth-child(2) {
    font-size: 10px;
  }
  .dock-ship b {
    width: 100%;
    font-size: 8px;
  }
  .ship-dock .fleet-actions button {
    font-size: 11px;
  }
  .board-ship {
    padding: 1px;
  }
  .shot-mark {
    font-size: 18px;
  }
  .sea-cell.miss .shot-mark {
    font-size: 23px;
  }
  .fleet-boards .board-help {
    font-size: 10px;
  }
}
.sea-numbers {
  grid-template-columns: repeat(var(--size, 10), 1fr);
}
.sea-letters {
  grid-template-rows: repeat(var(--size, 10), 1fr);
}
@media (max-width: 760px) {
  .cross-cell input {
    font-size: 16px;
    padding-top: 4px;
  }
  .cross-cell > span {
    font-size: 6px;
  }
  .crossword-grid {
    gap: 2px;
  }
}
.fleet-mini-menu {
  position: fixed;
  z-index: 65;
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid #d5ddd5;
  border-radius: 15px;
  background: #fffef8f5;
  box-shadow: 0 6px 24px #273c3b26;
  visibility: hidden;
  touch-action: manipulation;
  backdrop-filter: blur(8px);
}
.fleet-mini-menu button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: #edf1e7;
  color: #425449;
  touch-action: manipulation;
}
.fleet-mini-menu svg {
  width: 21px;
  height: 21px;
}
.fleet-mini-menu #fleetNearRemove {
  background: #f6e7df;
  color: #98624e;
}
.fleet-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 60;
  filter: drop-shadow(0 9px 5px #36484655);
  border-radius: 6px;
  background: #b7cda342;
  outline: 2px solid #8ca176;
}
.fleet-drag-ghost.invalid {
  outline-color: #c78c73;
  background: #e6baa15c;
  opacity: 0.75;
}
.fleet-dragging .board-ship.is-selected {
  opacity: 0.25;
}
.sea-grid[data-fleet-edit] .sea-cell,
.dock-ship {
  touch-action: none;
}
.fleet-tools #fleetRotate {
  display: grid;
  place-items: center;
  min-width: 46px;
  width: 46px;
  height: 46px;
  padding: 11px;
}
.fleet-tools #fleetRotate svg {
  width: 22px;
  height: 22px;
}
.fleet-tools {
  position: relative;
}
.fleet-planning {
  position: relative;
}
