:root {
  --ink: #17191f;
  --paper: #f6f8fb;
  --panel: #11141b;
  --line: #232733;
  --cell: #ffffff;
  --accent: #ff2e63;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  min-height: 100vh;
}

.board-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(14px, 3vw, 40px);
}

.board {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  width: min(calc(100vw - 360px), calc(100vh - 64px), 920px);
  min-width: 320px;
  aspect-ratio: 1;
  gap: 2px;
  padding: 2px;
  background: var(--line);
  border: 2px solid var(--line);
  box-shadow: 0 24px 70px rgba(23, 25, 31, 0.18);
}

.cell {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--cell);
  cursor: pointer;
  transition: filter 120ms ease, transform 120ms ease, background 70ms linear;
}

.cell:hover {
  filter: brightness(0.95);
}

.cell:focus-visible {
  outline: 4px solid #00c2a8;
  outline-offset: -5px;
  z-index: 2;
}

.cell.is-selected::after {
  position: absolute;
  inset: 8%;
  content: "";
  border: 4px solid var(--ink);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.control-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 24px;
  color: #fff;
  background: var(--panel);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.online-status {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt {
  max-width: 100%;
  font-size: clamp(32px, 4vw, 58px);
  font-weight: 900;
  line-height: 0.98;
  text-align: left;
  letter-spacing: 0;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 22px;
}

.color-stack {
  display: grid;
  justify-items: center;
  width: 100px;
  gap: 14px;
}

.color-preview {
  width: 88px;
  aspect-ratio: 1;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.28);
}

.hue-slider {
  width: 112px;
  accent-color: var(--accent);
  cursor: pointer;
}

.push-button {
  display: inline-grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 16px 0 #950b2d, 0 24px 44px rgba(0, 0, 0, 0.34);
  cursor: pointer;
  font-size: 27px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  transform: translateY(-8px);
  transition: transform 80ms ease, box-shadow 80ms ease, filter 120ms ease;
  user-select: none;
  touch-action: none;
}

.push-button:hover {
  filter: brightness(1.06);
}

.push-button:focus-visible {
  outline: 4px solid #00c2a8;
  outline-offset: 6px;
}

.push-button.is-active {
  box-shadow: 0 5px 0 #950b2d, 0 10px 22px rgba(0, 0, 0, 0.32);
  transform: translateY(4px);
}

[hidden] {
  display: none !important;
}

@media (max-width: 800px) {
  body {
    overflow: auto;
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 176px;
  }

  .board-zone {
    padding: 14px;
  }

  .board {
    width: min(calc(100vw - 28px), calc(100vh - 220px));
    min-width: 0;
  }

  .control-zone {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 0;
  }

  .online-status {
    top: 14px;
    left: 16px;
    right: 16px;
    font-size: 14px;
    text-align: center;
  }

  .prompt {
    max-width: 420px;
    font-size: clamp(28px, 10vw, 44px);
    text-align: center;
  }

  .push-button {
    width: 112px;
    height: 112px;
    font-size: 23px;
  }

  .color-stack {
    width: 90px;
  }

  .color-preview {
    width: 76px;
  }
}
