/* ============================================================
   3 skupaj — game specific styles
   ============================================================ */
:root { --chrome: 250px; --board-cap: 520px; }

#timed .chip.on  { background: var(--sky);   box-shadow: 0 5px 0 var(--sky-d); }
#langs .chip.on  { background: var(--mint);  box-shadow: 0 5px 0 var(--mint-d); }

.board {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  gap: clamp(6px, 1.4vh, 14px);
}

/* ---------- solved groups ---------- */
.solved {
  width: 100%;
  max-width: min(100%, calc(100vh  - var(--chrome)), var(--board-cap));
  max-width: min(100%, calc(100dvh - var(--chrome)), var(--board-cap));
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 1vh, 10px);
}
.solved:empty { display: none; }

.solved-row {
  border-radius: 18px;
  padding: clamp(6px, 1.2vh, 12px) 12px;
  text-align: center;
  color: #fff;
  animation: rise .4s cubic-bezier(.2,.9,.3,1.4);
  box-shadow: 0 4px 0 rgba(35,48,74,.18);
}
@keyframes rise { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.solved-row .cat { display: block; font-weight: 700; font-size: clamp(.85rem, 2.2vh, 1.05rem); }
.solved-row .ws  { display: block; font-weight: 500; font-size: clamp(.72rem, 1.9vh, .92rem); opacity: .92; margin-top: 2px; }
.solved-row.sun   { background: var(--sun);   color: var(--ink); box-shadow: 0 4px 0 var(--sun-d); }
.solved-row.mint  { background: var(--mint);  box-shadow: 0 4px 0 var(--mint-d); }
.solved-row.sky   { background: var(--sky);   box-shadow: 0 4px 0 var(--sky-d); }
.solved-row.grape { background: var(--grape); box-shadow: 0 4px 0 var(--grape-d); }
.solved-row.coral { background: var(--coral); box-shadow: 0 4px 0 var(--coral-d); }

/* ---------- grid ---------- */
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1.4vmin, 12px);
  width: 100%;
  max-width: min(100%, calc(100vh  - var(--chrome)), var(--board-cap));
  max-width: min(100%, calc(100dvh - var(--chrome)), var(--board-cap));
}

.tile {
  aspect-ratio: 1.12;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 5px;
  border: 4px solid transparent;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.1;
  hyphens: auto;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(35,48,74,.13);
  transition: transform .1s ease, box-shadow .1s ease, background .15s ease, border-color .15s ease;
}
.tile:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(35,48,74,.13); }
.tile.on {
  background: var(--ink);
  color: #fff;
  border-color: rgba(35,48,74,.2);
  box-shadow: 0 5px 0 #101a2c;
  transform: translateY(1px);
}
.tile.shake { animation: shake .35s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-4px); }
}
.grid3.locked .tile { pointer-events: none; }

/* velikost pisave glede na dolžino besede */
.tile.len1 { font-size: clamp(.8rem, 3.6vmin, 1.35rem); }
.tile.len2 { font-size: clamp(.72rem, 3.1vmin, 1.15rem); }
.tile.len3 { font-size: clamp(.64rem, 2.6vmin, .98rem); }
.tile.len4 { font-size: clamp(.56rem, 2.2vmin, .84rem); }
.tile.len5 { font-size: clamp(.5rem, 1.9vmin, .74rem); }

/* ---------- lives + message ---------- */
.lives-row { display: flex; align-items: center; gap: 8px; }
.lives-label { font-weight: 600; color: var(--ink-soft); font-size: clamp(.8rem, 2.1vh, 1rem); }
.lives { display: flex; gap: 5px; }
.lives span {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 2px 0 rgba(35,48,74,.15);
  transition: background .3s ease, transform .3s ease;
}
.lives span.gone { background: #D8DEE9; transform: scale(.72); }

.message {
  text-align: center;
  min-height: 1.8em;
  font-size: clamp(.95rem, 2.6vh, 1.3rem);
  font-weight: 600;
  color: var(--ink-soft);
}
.message.good { color: var(--mint-d); }
.message.bad  { color: var(--coral-d); }

.score-chip.current .val { color: var(--grape-d); }
.score-chip.best .val { color: var(--sun-d); }
.score-chip.time .val { color: var(--sky-d); }
.score-chip.time.low .val { color: var(--coral-d); }

/* ---------- overlay ---------- */

@media (orientation: landscape) and (max-height: 560px) {
  :root { --chrome: 190px; --board-cap: 340px; }
  .lives span { width: 10px; height: 10px; }
}

/* telefon na boku: ploščice naj bodo široke in nizke, ne visoke */
@media (orientation: landscape) and (max-height: 400px) {
  .grid3, .solved {
    max-width: min(100%, 62vw);
  }
  .tile { aspect-ratio: 2.7; border-radius: 14px; border-width: 3px; }
  .solved-row { padding: 4px 10px; border-radius: 12px; }
  .solved-row .cat { font-size: .8rem; }
  .solved-row .ws { font-size: .68rem; }
  .lives-row { gap: 6px; }
  .lives-label { font-size: .78rem; }
  .lives span { width: 9px; height: 9px; }
  .message { min-height: 1.3em; font-size: .85rem; }
  .board { gap: 5px; }
}
@media (max-width: 480px) {
  :root { --chrome: 290px; --board-cap: 360px; }
}
