:root {
  color-scheme: dark;
  font:
    16px/1.5 ui-sans-serif,
    system-ui,
    sans-serif;
  color: #f1f0fb;
  background: #0b1022;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 85% 35%, #24305280, transparent 55%);
}
main {
  max-width: 1160px;
  margin: auto;
  padding: 28px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #36425b;
  padding-bottom: 24px;
  gap: 18px;
}
header a {
  color: #c5ceff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.1em;
}
header span,
.eyebrow {
  color: #acbaf3;
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
}
.intro {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0 42px;
  padding: 30px 0;
}
.intro .eyebrow {
  grid-column: 1/-1;
}
h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.07;
  letter-spacing: -0.045em;
  margin: 10px 0;
}
h1 em {
  font-style: normal;
  color: #a8f0df;
}
.intro > p:last-child {
  align-self: end;
  max-width: 380px;
  color: #b9c5df;
}
.game {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  border: 1px solid #475170;
  border-radius: 20px;
  overflow: hidden;
  background: #101831;
}
.flight {
  padding: 24px;
  background: linear-gradient(145deg, #172342, #10172c);
}
.hud {
  display: flex;
  justify-content: space-between;
  font:
    700 12px ui-monospace,
    monospace;
  color: #b9caf5;
  margin-bottom: 20px;
}
#board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  aspect-ratio: 1;
  max-width: 470px;
  margin: auto;
}
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #303e62;
  border-radius: 8px;
  background: #17203a;
  color: #a9bee6;
  font-size: clamp(18px, 3vw, 29px);
}
.cell.rock {
  background: #34415e;
  color: #acb9d5;
  border-color: #526181;
}
.cell.core {
  color: #ffeab3;
  background: #51442b;
  border-color: #9f8851;
  box-shadow: inset 0 0 16px #e0af261f;
}
.cell.exit {
  color: #d0c4ff;
  border: 2px solid #a993fa;
  background: #39305f;
}
.cell.trail {
  background: #25365a;
}
.cell.ship {
  color: #092627;
  background: #a8f0df;
  border-color: #d8fff3;
  box-shadow: 0 0 18px #a8f0df44;
}
.legend {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: #c6cee4;
  font-size: 11px;
  margin-top: 18px;
}
aside {
  padding: 28px;
}
h2 {
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
#status {
  color: #b6f4e3;
  min-height: 52px;
}
.hint,
details,
footer {
  color: #b9c5df;
  font-size: 13px;
}
.controls {
  display: grid;
  grid-template-columns: repeat(3, 54px);
  gap: 8px;
  margin: 24px 0;
}
.controls button:first-child {
  grid-column: 2;
}
.controls button:nth-child(2) {
  grid-column: 1;
}
button {
  border: 1px solid #627193;
  border-radius: 9px;
  background: #243255;
  color: #f5f6ff;
  padding: 12px;
  cursor: pointer;
  font: inherit;
}
.controls button {
  font-size: 23px;
  line-height: 1;
}
button:hover:not(:disabled) {
  background: #384b78;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #b6f4e3;
  outline-offset: 4px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
details {
  margin-top: 24px;
}
summary {
  cursor: pointer;
}
pre {
  letter-spacing: 0.35em;
  color: #dce3fa;
}
footer {
  padding: 24px 0;
  text-align: center;
}
@media (max-width: 700px) {
  main {
    padding: 16px;
  }
  header span {
    display: none;
  }
  .intro {
    display: block;
    padding: 22px 0;
  }
  .intro > p:last-child {
    max-width: none;
  }
  .game {
    grid-template-columns: 1fr;
  }
  .flight {
    padding: 18px;
  }
  aside {
    padding: 22px;
  }
  .cell {
    border-radius: 5px;
  }
  .controls {
    margin: 18px auto;
  }
  .actions {
    justify-content: center;
  }
}
@media (max-width: 700px) {
  aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "status status" "controls actions" "map map";
    gap: 8px;
    padding: 18px;
  }
  aside > .eyebrow,
  aside > h2,
  aside > .hint {
    display: none;
  }
  #status {
    grid-area: status;
    min-height: 44px;
    margin: 0;
  }
  .controls {
    grid-area: controls;
    margin: 8px 0;
    grid-template-columns: repeat(3, 44px);
    gap: 5px;
  }
  .controls button {
    padding: 10px;
  }
  .actions {
    grid-area: actions;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }
  .actions button {
    padding: 9px;
  }
  details {
    grid-area: map;
    margin-top: 8px;
  }
}
