/* achievements.css — Tablić's medals (achievements.js): the coin, the toast, the sheet, the
   game-over strip and the start card's medal button. Cut from the kafana tokens in style.css
   (linked before this sheet): espresso plates with the woven band as a BACKGROUND LAYER of the
   plate, never a positioned strip; saffron and brass; Playfair for names. */

/* ── the coin ──────────────────────────────────────────────────────────────────
   Struck brass when won (the game-over medal's metal), a dark espresso blank when not. */
.ach-medal { --m: 56px; width: var(--m); height: var(--m); min-width: var(--m); border-radius: 50%;
    display: grid; place-items: center; position: relative;
    background: radial-gradient(circle at 35% 30%, var(--esp-600), var(--esp-950) 74%);
    box-shadow: inset 0 0 0 1px rgba(217, 164, 65, 0.22), inset 0 -4px 8px rgba(0, 0, 0, 0.45);
    color: rgba(243, 233, 214, 0.34); }
.ach-medal svg { width: 82%; height: 82%; display: block; }
.ach-medal .ach-ring { opacity: 0.55; }
.ach-medal.on { background: radial-gradient(circle at 35% 30%, var(--saffron-hi), #a8701c 72%);
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.13), inset 0 -5px 10px rgba(0, 0, 0, 0.2), 0 0 0 4px rgba(224, 168, 58, 0.16),
        0 6px 14px rgba(0, 0, 0, 0.45);
    color: var(--kilim-deep); }
.ach-medal.on .ach-ring { opacity: 0.8; }

/* ── the toast ─────────────────────────────────────────────────────────────────
   Top centre, under the header / Menu button, over the opponent's face-down hand: game.js only
   lets it show while the board waits for the player or a deal sheet is up, never mid-flight. */
.ach-toast { position: fixed; z-index: 260; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px));
    display: flex; align-items: center; gap: 12px; max-width: min(360px, calc(100vw - 32px));
    padding: 16px 18px 10px 12px; border-radius: 14px; cursor: pointer;
    background: var(--band) repeat-x 0 0 / auto 8px, linear-gradient(180deg, var(--esp-700), var(--esp-900));
    border: 1px solid rgba(242, 199, 102, 0.55);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 34px rgba(0, 0, 0, 0.6);
    opacity: 0; pointer-events: none; transform: translate(-50%, -10px);
    transition: opacity .28s var(--ease-out), transform .36s var(--ease-out); }
.ach-toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.ach-toast.out { opacity: 0; transform: translate(-50%, -6px); transition-duration: .25s; }
.ach-toast .ach-medal { --m: 46px; }
.ach-toast.show .ach-medal { animation: ach-strike .7s var(--ease-out) both .08s; }
@keyframes ach-strike { 0% { transform: scale(0.5) rotate(-24deg); } 70% { transform: scale(1.08) rotate(4deg); } 100% { transform: none; } }
.ach-toast-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ach-toast-text small { white-space: nowrap; font: 600 11px/1.2 "Work Sans", system-ui, sans-serif; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--cream-dim); }
.ach-toast-text b { font: 700 19px/1.15 "Playfair Display", Georgia, serif; color: var(--saffron-hi);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── the sheet ─────────────────────────────────────────────────────────────────
   The shared .overlay scrim with a wide plate: a fixed head, a scrolling grid of medals. */
#ach-sheet { z-index: 230; }
#ach-sheet .ach-panel { width: min(780px, 94vw); max-height: calc(100dvh - 32px); text-align: left;
    padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.ach-head { display: flex; align-items: center; gap: 12px; padding: 24px 12px 12px 22px; flex: 0 0 auto;
    border-bottom: 1px solid var(--line-soft); }
.ach-head h2 { margin: 0; font-size: 28px; }
.ach-count { font-size: 13px; color: var(--cream-dim); letter-spacing: 0.04em; font-variant-numeric: tabular-nums;
    padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(0, 0, 0, 0.25); white-space: nowrap; }
.ach-close { margin-left: auto; width: 44px; height: 44px; min-width: 44px; border-radius: 50%; display: grid; place-items: center;
    background: rgba(255, 236, 200, 0.06); color: var(--saffron-hi); border: 1px solid var(--line); cursor: pointer;
    touch-action: manipulation; transition: background .18s; }
.ach-close:hover { background: rgba(255, 236, 200, 0.12); }
.ach-grid { list-style: none; margin: 0; padding: 14px 16px 6px; overflow-y: auto; -webkit-overflow-scrolling: touch;
    flex: 1 1 auto; min-height: 0; touch-action: pan-y;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-content: start; }
.ach-item { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 12px;
    border-radius: 12px; background: rgba(0, 0, 0, 0.24); border: 1px solid var(--line-soft); min-width: 0; }
.ach-item.on { background: linear-gradient(180deg, rgba(224, 168, 58, 0.1), rgba(0, 0, 0, 0.18)); border-color: rgba(224, 168, 58, 0.4); }
.ach-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ach-name { font: 700 16px/1.2 "Playfair Display", Georgia, serif; color: var(--cream); }
.ach-item.on .ach-name { color: var(--saffron-hi); }
.ach-desc { font-size: 13px; line-height: 1.35; color: var(--cream-dim); }
.ach-foot { font-size: 12px; color: var(--saffron); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ach-foot.progress { display: flex; align-items: center; gap: 8px; color: var(--cream-dim); }
/* the free app: a medal behind the full version (achievements.js setLockCheck) */
.ach-foot.locked { color: var(--cream-dim); font-style: italic; }
.ach-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }
.ach-bar > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #b07a24, var(--saffron-hi)); }
.ach-note { flex: 0 0 auto; margin: 0; padding: 8px 22px 16px; font-size: 12px; line-height: 1.45; color: var(--cream-dim); }

/* ── the game-over strip: this match's new medals, a door to the sheet ─────────── */
.ach-go { display: block; width: 100%; margin: 12px 0 2px; padding: 10px 10px 8px; border-radius: 12px; cursor: pointer;
    background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(224, 168, 58, 0.4); color: inherit; font: inherit;
    touch-action: manipulation; transition: background .18s; }
.ach-go:hover { background: rgba(224, 168, 58, 0.1); }
.ach-go-head { display: block; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cream-dim); margin-bottom: 8px; }
.ach-go-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.ach-go-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 78px;
    animation: ach-go-in .5s var(--ease-out) both; animation-delay: calc(.5s + var(--i, 0) * 120ms); }
.ach-go-item .ach-medal { --m: 44px; }
.ach-go-name { font: 700 12px/1.2 "Playfair Display", Georgia, serif; color: var(--saffron-hi); text-align: center; }
@keyframes ach-go-in { from { opacity: 0; transform: translateY(6px) scale(0.9); } }

/* ── the start card's medal button: a square at the end of the Multiplayer / Rules row ───── */
.btn-row .primary-btn.alt.ach-start-btn { flex: 0 0 50px; width: 50px; padding: 0; display: grid; place-items: center; color: var(--saffron-hi); }
.ach-start-btn svg { width: 24px; height: 24px; display: block; }
/* with the medal in the row, the two words share what is left by their own length (Greek
   "Πολλοί παίκτες" is twice "Κανόνες"), so neither is cut at the 812x375 phone */
.start-panel .btn-row .primary-btn.alt:not(.ach-start-btn) { flex: 1 1 auto; width: auto; min-width: 0; padding-left: 8px; padding-right: 8px; }

/* short landscape phones (812x375 … the 640x300 floor): smaller coins, two columns */
@media (max-height: 520px) and (orientation: landscape) {
    #ach-sheet .ach-panel { width: min(760px, 96vw); max-height: calc(100dvh - 20px); }
    #ach-sheet { padding: 10px; }
    .ach-head { padding: 16px 10px 8px 18px; }
    .ach-head h2 { font-size: 22px; }
    .ach-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 10px 12px 4px; }
    .ach-item { padding: 7px 10px; gap: 10px; }
    .ach-medal { --m: 44px; }
    .ach-desc { font-size: 12px; }
    .ach-note { padding: 6px 18px 10px; font-size: 11.5px; }
    .ach-toast { top: calc(56px + env(safe-area-inset-top, 0px)); padding: 13px 16px 8px 10px; }
    .ach-toast .ach-medal { --m: 40px; }
    .ach-go { margin-top: 8px; padding: 8px; }
    .ach-go-item .ach-medal { --m: 36px; }
}
@media (max-height: 340px) and (orientation: landscape) {
    .ach-note { display: none; }
    .btn-row .primary-btn.alt.ach-start-btn { flex-basis: 44px; width: 44px; }
}
@media (max-width: 520px) and (orientation: portrait) {
    .ach-grid { grid-template-columns: 1fr; padding: 12px 12px 4px; }
    .ach-head { padding-left: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .ach-toast { transform: translate(-50%, 0); }
    .ach-toast.show .ach-medal, .ach-go-item { animation: none; }
}
