/* Top 5 game. Uses the colours and buttons from crossword.css. */
.t5-head { margin-bottom: 14px; }
.t5-kicker { font-size: 13px; font-weight: 500; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 4px; }
.t5-title { font-size: 24px; font-weight: 500; line-height: 1.2; margin: 0 0 6px; }
.t5-asof { font-size: 13px; color: var(--muted); margin: 0; }

.t5-board { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; padding: 0; list-style: none; }
.t5-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; min-height: 56px; }
.t5-rank { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 500; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.t5-name { flex: 1; font-weight: 500; font-size: 17px; color: var(--muted); letter-spacing: .08em; overflow-wrap: anywhere; }
.t5-name.t5-blank { flex: none; width: 45%; max-width: 220px; height: 14px; border-radius: 7px; background: #e3e7ef; }
.t5-val { flex: none; font-size: 15px; color: var(--muted); }
.t5-row.found { background: var(--green); border-color: var(--green); animation: t5-pop .35s; }
.t5-row.found .t5-rank { background: var(--green-ink); color: #fff; }
.t5-row.found .t5-name { color: var(--ink); letter-spacing: 0; }
.t5-row.found .t5-val { color: var(--green-ink); font-weight: 500; }
.t5-row.missed { background: var(--grey); }
.t5-row.missed .t5-name { color: var(--muted); letter-spacing: 0; font-weight: 350; }
.t5-row.missed .t5-rank { background: #d5d9e2; color: var(--muted); }

.t5-lives { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.t5-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red-ink); }
.t5-dot.lost { background: #d5d9e2; }

.t5-form { display: flex; gap: 8px; margin-bottom: 8px; }
.t5-input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); }
.t5-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.t5-msg { min-height: 22px; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.t5-msg.good { color: var(--green-ink); font-weight: 500; }
.t5-msg.bad { color: var(--red-ink); font-weight: 500; }
.t5-game .actions { justify-content: center; }
.t5-game.shake .t5-form { animation: t5-shake .4s; }

.t5-note { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.t5-note a { color: var(--muted); }

@keyframes t5-pop { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes t5-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

#top5 button, #top5 .t5-input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.t5-rules { margin-top: 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; line-height: 1.55; }
.t5-rules summary { cursor: pointer; padding: 14px 0; font-size: 15px; font-weight: 500; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.t5-rules summary::-webkit-details-marker { display: none; }
.t5-rules summary::after { content: "+"; font-size: 20px; font-weight: 350; color: var(--muted); }
.t5-rules[open] summary::after { content: "−"; }
.t5-rules ul { margin: 0 0 8px; padding-left: 18px; }
.t5-rules li { margin-bottom: 4px; }

.t5-pips { display: flex; gap: 6px; margin: 0 0 10px; }
.t5-pip { width: 28px; height: 6px; border-radius: 3px; background: var(--border); }
.t5-pip.now { background: var(--accent); }
.t5-pip.done { background: var(--green-ink); }
.t5-note { margin: 0 0 12px; }

.t5-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(17, 24, 39, .55); animation: t5-fade .2s; }
.t5-modal[hidden] { display: none; }
.t5-modal-card { display: flex; flex-direction: column; width: 100%; max-width: 380px; text-align: center; background: var(--card); border-radius: 16px; padding: 28px 22px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: t5-pop .3s; }
.t5-modal-card h2 { font-size: 26px; font-weight: 500; line-height: 1.2; margin: 0 0 10px; color: var(--head); }
.t5-modal-card p { color: var(--muted); margin: 0 0 14px; }
.t5-modal-card .win-perfect { color: var(--head); background: var(--accent-soft); border-radius: 10px; padding: 8px 10px; font-weight: 500; }
.t5-modal-card button { display: block; width: 100%; margin: 8px 0 0; }
.t5-modal-card button:not(.primary):not(.t5-link) { border-color: var(--line2); color: var(--head); }
.t5-modal-card .share-note { order: 3; margin: 8px 0 0; font-size: 13px; }
.t5-modal-card .t5-link { order: 4; border: 0; background: none; color: var(--accent); text-decoration: none; font-size: 14px; }
@media (min-width: 641px) and (hover: hover){.t5-modal-card .t5-link:hover{ text-decoration: underline; }}
@keyframes t5-fade { from { opacity: 0; } to { opacity: 1; } }

/* Georgian has no capitals: text-transform would turn the letters into Mtavruli, so switch it off */
html:lang(ka) .t5-kicker { text-transform: none; letter-spacing: 0; }

/* Layout from the design: a white card with the list on the left, lives + answer box + links on the right */
.t5-game { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.t5-card { flex: 1 1 520px; min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.t5-side { flex: 0 1 340px; min-width: 280px; display: flex; flex-direction: column; gap: 14px; }
.t5-pips, .t5-asof { display: none; }
.t5-cardhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.t5-title { font-size: 17px; font-weight: 500; line-height: 1.3; margin: 0; }
.t5-cardhead .count { color: var(--head); font-size: 14px; white-space: nowrap; }
.t5-board { margin: 0; gap: 8px; }
.t5-row { padding: 12px 14px; border-radius: 10px; gap: 14px; }
.t5-row.found { background: var(--accent-soft); border-color: var(--border); }
.t5-row.found .t5-rank { background: var(--main); color: #fff; }
.t5-row.found .t5-val { color: var(--head); }
.t5-lives { justify-content: space-between; color: var(--head); }
.t5-dots { display: flex; gap: 6px; }
.t5-dot { width: 16px; height: 16px; background: var(--main); }
.t5-dot.lost { background: var(--border); }
.t5-input { border: 1px solid var(--line2); padding: 13px 16px; }
.t5-input::placeholder { color: var(--ph); opacity: 1; }
.t5-form { margin: 0; }
.t5-msg { margin: 0; min-height: 0; }
.t5-note { margin: 0; }
.t5-game .actions { justify-content: flex-start; gap: 18px; }
.t5-game .actions button { background: none; border: 0; padding: 0; font-size: 14px; color: var(--head); text-decoration: underline; cursor: pointer; }
.t5-game .actions button:disabled { opacity: .4; }
@media (max-width: 640px) {
  .t5-game { gap: 14px; }
  .t5-card { padding: 14px; border-radius: 14px; flex-basis: 100%; }
  .t5-side { flex-basis: 100%; min-width: 0; }
  .t5-title { font-size: 15px; }
  .t5-cardhead .count { font-size: 13px; }
  .t5-row { padding: 10px 12px; gap: 12px; }
}
@media (min-width: 900px) { #top5 main.narrow { max-width: 1000px; } }

.t5-row.can-hint { cursor: pointer; }
.t5-row.can-hint:focus-visible{ border-color: var(--accent); outline: none; }@media (min-width: 641px) and (hover: hover){.t5-row.can-hint:hover{ border-color: var(--accent); outline: none; }}
.t5-tip { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.t5-hint-ic { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-left: auto; border-radius: 10px; color: var(--accent); background: var(--accent-soft); flex: none; }
@media (min-width: 641px) and (hover: hover){.t5-row.can-hint:hover .t5-hint-ic{ background: var(--accent); color: #fff; }}
