:root {
  color-scheme: dark;
  font-family: 'Geist', 'Segoe UI', system-ui, sans-serif;
  color: #f3f5f3;
  background: #101519;
  --panel: #171e22;
  --border: #343d43;
  --muted: #aab6bc;
  --accent: #ddfc80;
  --correct: #b4dd76;
  --present: #f0ca78;
  --absent: #434e57;
  --mono: 'IBM Plex Mono', 'Cascadia Code', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 280px; margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }

.site-header { border-bottom: 1px solid #2a343a; }
.header-inner, .layout { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.header-inner { height: 76px; display: flex; justify-content: space-between; align-items: center; }
.wordmark { display: inline-flex; align-items: center; font-size: 26px; font-weight: 800; letter-spacing: -.06em; }
.brand-period, h1 span, .creator h2 span { color: var(--accent); }
.brand-icon { display: grid; grid-template-columns: repeat(2, 8px); gap: 3px; margin-right: 11px; transform: rotate(-8deg); }
.brand-icon i { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.brand-icon i:nth-child(2) { background: #f0ca78; }
.brand-icon i:nth-child(3) { background: #4b5960; }
.outline-button, .primary-button {
  min-height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: #f3f5f3;
  font-size: 13px;
  font-weight: 650;
}
.outline-button:hover { border-color: #85908e; background: #ffffff08; }
.outline-button span { color: var(--accent); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(285px, 330px); gap: 24px; margin-block: 36px 44px; align-items: start; }
.game, .creator, .guide { border: 1px solid var(--border); border-radius: 18px; }
.game { overflow: hidden; background: var(--panel); }
.game-header { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding: 24px 29px 22px; border-bottom: 1px solid #30393f; }
.eyebrow, .counter { font: 600 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .13em; }
.eyebrow { color: var(--accent); margin-bottom: 6px; }
.counter { color: var(--muted); white-space: nowrap; padding-bottom: 5px; }
h1 { font-size: clamp(29px, 4vw, 46px); font-weight: 770; line-height: 1.08; letter-spacing: -.055em; }
.game-body { padding: 15px 20px 25px; display: grid; justify-items: center; gap: 15px; }
.status { color: var(--muted); font-size: 13px; text-align: center; min-height: 19px; }
.status.error, .creator-status.error { color: #ffa99c; }
.board { display: grid; gap: 6px; width: 100%; justify-items: center; }
.board-row { display: grid; grid-template-columns: repeat(var(--columns, 5), minmax(0, 1fr)); gap: clamp(3px, 1vw, 7px); width: min(100%, calc(var(--columns, 5) * 64px - 7px)); }
.tile {
  height: clamp(36px, 6.5vh, 54px);
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #38434a;
  border-radius: 8px;
  background: #1c252a;
  color: #f3f5f3;
  font: 700 clamp(18px, 4vw, 27px)/1 var(--mono);
}
.board.cols-4 { --columns: 4; }
.board.cols-6 { --columns: 6; }
.board.cols-7 { --columns: 7; }
.board.cols-8 { --columns: 8; }
.tile.active { border-color: #647279; background: #242f35; }
.tile.active:hover { border-color: #a6b5ad; }
.tile.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tile.selected:empty::after { content: ''; height: 2px; width: 12px; border-radius: 1px; background: var(--accent); align-self: end; margin-bottom: 9px; }
.keyboard { display: grid; gap: 5px; width: min(100%, 480px); margin-top: 3px; }
.key-row { display: flex; justify-content: center; gap: 4px; }
.key {
  display: grid;
  place-items: center;
  flex: 0 1 39px;
  min-width: 0;
  height: 39px;
  padding: 0;
  border: 1px solid #435158;
  border-radius: 5px;
  background: #2c383f;
  color: #f3f5f3;
  font: 650 clamp(11px, 2.6vw, 14px)/1 var(--mono);
}
.key.action { flex-basis: 65px; padding-inline: 3px; font-size: 11px; }
.key:not(:disabled):hover { filter: brightness(1.25); }
.key:disabled { opacity: .78; }
.correct, .present, .absent { border-color: transparent; }
.correct { background: var(--correct); color: #172215; }
.present { background: var(--present); color: #2b2210; }
.absent { background: var(--absent); color: #fff; }
.result { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 14px; color: var(--muted); }
.result-title { font-size: 22px; font-weight: 750; color: var(--accent); }
.result .outline-button { margin-top: 5px; }

.side { display: grid; gap: 18px; }
.creator { position: relative; overflow: hidden; background: #202a23; border-color: #3b4b3e; padding: 25px; }
.creator-art { position: absolute; top: 23px; right: 22px; width: 66px; height: 68px; pointer-events: none; color: var(--accent); }
.creator-art span { position: absolute; line-height: 1; }
.creator-art span:nth-child(1) { font-size: 41px; right: 13px; top: 14px; }
.creator-art span:nth-child(2) { font-size: 17px; right: 1px; top: 2px; opacity: .78; }
.creator-art span:nth-child(3) { font-size: 15px; left: 1px; bottom: 6px; opacity: .64; }
.creator h2 { font-size: 34px; font-weight: 760; letter-spacing: -.055em; line-height: 1.05; }
.creator > p, .guide > p { font-size: 14px; line-height: 1.55; color: var(--muted); }
.creator > p { margin-top: 13px; max-width: 240px; }
.creator form, .share { display: grid; gap: 8px; margin-top: 20px; }
label { color: #d4ddd5; font-size: 12px; font-weight: 650; }
input { width: 100%; min-height: 44px; padding: 10px 12px; color: #f3f5f3; background: #121b16; border: 1px solid #4b5a4e; border-radius: 7px; font-size: 14px; }
input::placeholder { color: #a1afa5; }
.primary-button { margin-top: 3px; justify-content: space-between; background: var(--accent); color: #19220e; border-color: var(--accent); }
.primary-button:hover { background: #e8ffa6; }
.primary-button:disabled { opacity: .7; }
.creator .creator-status:empty { margin: 0; }
.share { margin-top: 14px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.share-actions > * { flex: 1 0 max-content; }

.guide { padding: 22px 25px; background: var(--panel); }
.guide h2 { font-size: 17px; letter-spacing: -.025em; margin-bottom: 6px; }
.guide ul { list-style: none; padding: 0; margin: 15px 0 0; display: grid; gap: 7px; }
.guide li { display: flex; align-items: center; gap: 9px; color: #d9dfdf; font-size: 12px; }
.example { display: grid; place-items: center; border-radius: 4px; width: 23px; height: 23px; font: 750 12px/1 var(--mono); }
#game-effect { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

@media (max-width: 820px) {
  .header-inner, .layout { width: calc(100% - 36px); }
  .layout { gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(245px, 280px); }
  .creator, .guide { padding: 19px; }
  .creator-art { right: 14px; }
}
@media (max-width: 740px) {
  .layout { grid-template-columns: 1fr; max-width: 540px; margin-block: 18px 25px; }
  .header-inner { height: 61px; }
  .game-header { padding: 19px 14px 16px; }
  .game-body { padding: 13px 8px 17px; gap: 11px; }
  .board { gap: 4px; }
  .key-row { gap: 3px; }
}
@media (max-width: 370px) {
  .header-inner, .layout { width: calc(100% - 20px); }
}
