.narrow { max-width: 520px; }
:root { --wg-absent: #6b7080; --wg-absent-key: #8c93a6; }
:root[data-theme="dark"] { --wg-absent: #2b3350; --wg-absent-key: #232a42; }
.mode { margin-bottom: 10px; }
.toast { position: relative; height: 2.2em; text-align: center; }
.toast span {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 800;
  color: var(--bg);
  background: var(--ink);
  box-shadow: var(--shadow);
  animation: toast 1.6s ease forwards;
}
@keyframes toast { 0% { opacity: 0; transform: translateY(6px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.board { --w: min(calc((100vw - 32px - 24px) / 5), 62px); display: grid; gap: 6px; justify-content: center; margin: 6px 0 14px; }
.row { display: grid; grid-template-columns: repeat(5, var(--w)); gap: 6px; }
.row.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.tile {
  height: var(--w);
  display: grid;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 6px;
  font: 800 calc(var(--w) * 0.55) "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.1s;
}
.tile.filled { border-color: color-mix(in srgb, var(--ink) 65%, transparent); animation: pop 0.1s; }
@keyframes pop { 50% { transform: scale(1.08); } }
.tile.reveal { animation: flip 0.5s ease forwards; animation-delay: calc(var(--i) * 0.25s); }
@keyframes flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}
.tile.correct { background: #3f9d6f; border-color: #3f9d6f; color: #fff; }
.tile.present { background: #c9a227; border-color: #c9a227; color: #fff; }
.tile.absent { background: var(--wg-absent); border-color: var(--wg-absent); color: #e6e8ef; }
.tile.win { animation: hop 0.6s ease; animation-delay: calc(var(--i) * 0.08s); }
@keyframes hop { 40% { transform: translateY(-14px); } }

.kbd { display: grid; gap: 6px; max-width: 500px; margin: 0 auto; }
.krow { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1;
  max-width: 44px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  font: 800 1rem "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface-2);
  box-shadow: 0 3px 0 var(--line-strong);
  cursor: pointer;
  touch-action: manipulation;
}
.key.wide { flex: 1.6; max-width: 70px; font-size: 0.72rem; }
.key.correct { background: #3f9d6f; color: #fff; }
.key.present { background: #c9a227; color: #fff; }
.key.absent { background: var(--wg-absent-key); color: #fff; }
.key:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }

.big { font-size: 3rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 12px; }
.stats div b { display: block; font-size: 1.5rem; }
.stats div span { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.dist { display: grid; gap: 4px; text-align: left; }
.dist .bar { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.dist .bar i { display: block; height: 18px; min-width: 22px; padding: 0 6px; border-radius: 3px; background: var(--wg-absent); color: #fff; font-style: normal; font-weight: 800; text-align: right; color: #fff; }
.dist .bar i.hit { background: #3f9d6f; }
