/* Czech Wordle — game styles. Colours/fonts come from the shared theme.css. */

:root {
  --tile-correct: #4F9A5D;
  --tile-present: #D9A93A;
  --tile-absent:  #9B928A;
  --tile-gap: 6px;
  --key-bg: #EDE3D7;
}

/* ---- Header ---- */
.wordle-header { padding: .7rem 0 .9rem; }
.wordle-header .wrap { position: relative; justify-content: center; }
.wordle-header .site-title { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.hub-link {
  position: absolute; left: 0; color: #fff; opacity: .9;
  text-decoration: none; font-size: .9rem; font-weight: 600;
}
.hub-link:hover { text-decoration: underline; }
.help-btn {
  position: absolute; right: 0; width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.8); background: transparent; color: #fff;
  font-weight: 700; font-size: 1rem; cursor: pointer;
}
@media (max-width: 480px) { .hub-link { font-size: 0; } .hub-link::before { content: "←"; font-size: 1.2rem; } }

.wordle-main { max-width: 560px; padding-top: 1rem; }

/* ---- Settings ---- */
.settings { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.settings label {
  display: flex; flex-direction: column; gap: .2rem;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted);
}
.settings select {
  font: inherit; font-size: .95rem; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink);
  padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}

/* ---- Board ---- */
.round-info { text-align: center; color: var(--muted); font-size: .9rem; margin: 0 0 .6rem; }
.board {
  --len: 5;
  --tile: min(58px, calc((min(92vw, 520px) - (var(--len) - 1) * var(--tile-gap)) / var(--len)));
  display: grid; gap: var(--tile-gap); justify-content: center;
  max-height: 52vh; overflow-y: auto; padding: 2px;
}
.row { display: grid; grid-template-columns: repeat(var(--len), var(--tile)); gap: var(--tile-gap); }
.tile {
  width: var(--tile); height: var(--tile);
  display: grid; place-items: center;
  font-family: var(--font-body); font-weight: 700; text-transform: uppercase;
  font-size: calc(var(--tile) * .5); line-height: 1;
  border: 2px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink);
  user-select: none;
}
.tile.filled { border-color: var(--arrow); animation: pop .1s ease; }
.tile.correct, .tile.present, .tile.absent { color: #fff; border-color: transparent; }
.tile.correct { background: var(--tile-correct); }
.tile.present { background: var(--tile-present); }
.tile.absent  { background: var(--tile-absent); }
.tile.reveal { animation: flip .45s ease both; }
.row.shake { animation: shake .4s ease; }

@keyframes pop { 50% { transform: scale(1.08); } }
@keyframes flip {
  0%   { transform: rotateX(0); }
  50%  { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .tile.reveal, .row.shake, .tile.filled { animation: none; }
}

/* ---- Keyboard ---- */
.keyboard { margin-top: 1rem; display: grid; gap: 6px; user-select: none; }
.kb-row { display: flex; justify-content: center; gap: 5px; }
.key {
  flex: 1 1 0; max-width: 44px; height: 50px; padding: 0;
  border: 0; border-radius: 6px; background: var(--key-bg); color: var(--ink);
  font-family: var(--font-body); font-weight: 700; font-size: 1rem; text-transform: uppercase;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.kb-row.accents .key { height: 42px; font-size: .95rem; }
.key.wide { flex: 1.6 1 0; max-width: 68px; font-size: .75rem; }
.key:active { filter: brightness(.92); }
.key.correct { background: var(--tile-correct); color: #fff; }
.key.present { background: var(--tile-present); color: #fff; }
.key.absent  { background: var(--tile-absent);  color: #fff; }
.key:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }

.actions { display: flex; justify-content: center; gap: .6rem; margin-top: .9rem; }

/* ---- End panel + bonus ---- */
.end-panel { margin-top: 1rem; text-align: center; }
.answer-word {
  font-family: var(--font-head); font-size: 2rem; font-weight: 600; margin: .2rem 0 0; color: var(--plum);
}
.end-result { margin: 0 0 .6rem; color: var(--muted); }
.bonus h2 { font-family: var(--font-head); font-size: 1.15rem; margin: .8rem 0 .2rem; }
.bonus .pill { display: inline-block; margin-bottom: .6rem; }
.options { display: grid; gap: .5rem; grid-template-columns: 1fr 1fr; margin: .4rem 0 .8rem; }
@media (max-width: 420px) { .options { grid-template-columns: 1fr; } }
.option {
  font: inherit; font-weight: 600; padding: .7rem .8rem; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: center;
}
.option:hover:not([disabled]) { border-color: var(--plum); }
.option.right { background: var(--tile-correct); color: #fff; border-color: transparent; }
.option.wrong { background: #C8553D; color: #fff; border-color: transparent; }
.option[disabled] { cursor: default; }
.bonus-result { font-weight: 700; margin: 0 0 .8rem; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; top: 5.5rem; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .55rem 1rem; border-radius: 8px;
  font-weight: 600; font-size: .95rem; pointer-events: none;
  opacity: 0; transition: opacity .15s ease; z-index: 10;
}
.toast.show { opacity: 1; }

/* ---- Help dialog ---- */
.help { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-hover); max-width: 420px; padding: 1.2rem 1.4rem; color: var(--ink); }
.help::backdrop { background: rgba(42,35,32,.45); }
.help h2 { font-family: var(--font-head); margin-top: 0; }
.help ul { list-style: none; padding: 0; }
.help li { display: flex; align-items: center; gap: .6rem; margin: .35rem 0; }
.mini {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 4px;
  color: #fff; font-weight: 700;
}
.mini.correct { background: var(--tile-correct); }
.mini.present { background: var(--tile-present); }
.mini.absent  { background: var(--tile-absent); }

.error-box { text-align: center; padding: 2rem 0; }
