/* ==========================================================================
   Latin Vocab Top Trumps — styles for vocab.html
   The cards copy the printed deck. Their sizes are in cqw (hundredths of the
   card's width), so a card looks the same at any size: 1mm on the printed
   64mm card = 1.5625cqw, 1pt = 0.551cqw.
   ========================================================================== */

/* ---------------------------------------------------------- page and panels */
.vg { padding-bottom: var(--step); }
#vocab-app { --card-w: min(23rem, 100%); }
.vg-panel { background: #fff; border: 1px solid var(--rule-soft); border-radius: 6px; padding: clamp(1rem, 3vw, 1.6rem); margin-bottom: 1.4rem; }
.vg-h { font-size: 1.35rem; margin-bottom: .8rem; }
.vg-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .7rem; align-items: center; }
.vg-chips__label { font-family: var(--sans); font-size: .8rem; color: var(--text-soft); margin-right: .3rem; }
.vg-range { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; font-family: var(--sans); font-size: .9rem; }
.vg-range input { width: 4.6rem; font: inherit; padding: .35rem .5rem; border: 1px solid var(--rule); border-radius: var(--r); margin-left: .35rem; background: #fff; }
.vg-count { font-family: var(--sans); font-size: .9rem; margin: .8rem 0 0; color: var(--text-soft); }
.vg-count b { color: var(--text); }
.vg-link { background: none; border: 0; padding: 0; font: inherit; color: var(--sea-deep); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.vg-link:hover { color: var(--honey-dk); }
.vg-small { font-family: var(--sans); font-size: .82rem; color: var(--text-soft); }

.vg-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.vg-mode { background: var(--ink); color: #fff; border-radius: 6px; padding: 1.3rem 1.3rem 1.4rem; display: flex; flex-direction: column; align-items: flex-start; }
.vg-mode h3 { font-size: 1.5rem; margin-bottom: .4rem; }
.vg-mode p { color: #C9D5DE; font-size: .98rem; flex: 1; }
.vg-mode--flash { background: var(--sea-deep); }
.vg-mode--quiz { background: #5B4A2C; }
.vg-mode button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 52rem) { .vg-modes { grid-template-columns: 1fr; } .vg-mode p { flex: none; } }
.vg-progress { font-family: var(--sans); font-size: .92rem; color: var(--text-soft); }
.vg-progress b { color: var(--text); }

.vg-install { background: var(--shade-lt); }
.vg-install p { margin-bottom: .6rem; }
.vg-install p:last-child { margin-bottom: 0; }
.vg-share svg { width: 1.1em; height: 1.1em; vertical-align: -.15em; }

.vg-promo { display: flex; gap: 1.1rem; align-items: flex-start; border-top: 1px solid var(--rule); padding-top: 1.3rem; margin-top: 1.6rem; }
.vg-promo__mark { flex: none; width: 2.6rem; color: var(--ink); }
.vg-promo__mark svg { width: 100%; height: auto; }
.vg-promo__by { font-family: var(--sans); font-size: .9rem; margin-bottom: .4rem; color: var(--text-soft); }
.vg-promo__by .wm { color: var(--ink); margin-left: .35em; }
.vg-promo__list { margin: 0; padding-left: 1.1rem; font-size: .98rem; }
.vg-promo__list li { margin-bottom: .25rem; }

/* the custom wordmark letters, as on the rest of the site */
.wm { font-family: var(--name); font-weight: 400; letter-spacing: .105em; white-space: nowrap; }
.wm > span { opacity: .62; }
.wm .gl { display: inline-block; vertical-align: baseline; fill: currentColor; }
.wm .gl--a { width: .66em; height: .73em; }
.wm .gl--e { width: .55em; height: .70em; }

/* ---------------------------------------------------------- game screens */
.vg-playing .page-head { display: none; }
.vg-playing .vg { padding-top: 1.4rem; }
.vg-bar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.vg-title { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.2rem); margin: 0; }
.vg-home { font-family: var(--sans); font-size: .85rem; background: none; border: 1px solid var(--rule); border-radius: 99px; padding: .4rem .9rem; cursor: pointer; color: var(--text); }
.vg-home:hover { border-color: var(--ink); }
.vg-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-family: var(--sans); font-size: .88rem; color: var(--text-soft); max-width: 46rem; margin: 0 auto .7rem; }
.vg-toggle { display: inline-flex; gap: .4rem; align-items: center; cursor: pointer; }
.vg-stage { width: var(--card-w); margin: 0 auto; }
.vg-stage--sm { width: min(19rem, 100%); margin: .8rem 0; }
.vg-actions { display: flex; justify-content: center; gap: .8rem; margin: 1.2rem auto 0; }
.vg-actions .btn { min-width: 9rem; justify-content: center; }
.vg-end h3 { font-size: 1.8rem; }
.vg-review { columns: 2 14rem; padding-left: 1.1rem; }
.vg-review li { break-inside: avoid; }
.vg-kinds { justify-content: center; }

.vg-q { max-width: 46rem; margin-inline: auto; }
.vg-q-prompt { font-size: 1.3rem; line-height: 1.35; margin-bottom: 1rem; }
.vg-q-prompt b[lang=la] { font-style: italic; }
.vg-q-sub { font-size: .95rem; color: var(--text-soft); }
.vg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 34rem) { .vg-opts { grid-template-columns: 1fr; } }
.vg-opt { font-family: var(--sans); font-size: 1rem; text-align: left; padding: .8rem 1rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--text); cursor: pointer; line-height: 1.3; }
.vg-opt--la { font-family: var(--serif); font-style: italic; font-size: 1.15rem; }
.vg-opt:hover:not(:disabled) { border-color: var(--ink); background: #fff; }
.vg-opt:disabled { cursor: default; }
.vg-opt.is-right { background: #E3F0DF; border-color: #4C8A3F; color: #1E4A16; font-weight: 600; }
.vg-opt.is-wrong { background: #F7E1DE; border-color: #B5483C; color: #7A2017; }
.vg-verdict { margin: 1rem 0 .6rem; font-size: 1.1rem; }
.vg-verdict.is-right::before { content: "✓ "; color: #4C8A3F; }
.vg-verdict.is-wrong::before { content: "✗ "; color: #B5483C; }
.vg-peek { margin-bottom: 1rem; font-family: var(--sans); font-size: .9rem; }
.vg-peek summary { cursor: pointer; color: var(--sea-deep); }

.vg-credits { font-size: .98rem; }
.vg-credit-list { font-family: var(--sans); font-size: .8rem; line-height: 1.45; padding-left: 2.6rem; color: var(--text-soft); }
.vg-credit-list a { word-break: break-word; }

/* Top Trumps */
.tt-score { display: flex; justify-content: space-between; gap: .6rem; font-family: var(--sans); font-size: .95rem; max-width: 48rem; margin: 0 auto .6rem; }
.tt-score b { font-size: 1.25rem; margin-left: .25rem; }
.tt-pot { color: var(--honey-dk); }
.tt-msg { max-width: 48rem; margin: 0 auto 1rem; padding: .7rem 1rem; border-radius: 6px; background: var(--shade-lt); font-size: 1.05rem; line-height: 1.4; }
.tt-msg--you { background: #E3F0DF; }
.tt-msg--cpu { background: #F7E1DE; }
.tt-msg--draw { background: #F6EBD6; }
.tt-table { display: grid; grid-template-columns: repeat(2, minmax(0, 21rem)); justify-content: center; gap: 1.5rem; }
.tt-label { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-soft); margin: 0 0 .35rem; text-align: center; }
.tt-answer { max-width: 48rem; margin: 1.2rem auto 0; }
.tt-next { margin-top: 1rem; text-align: center; }
.tt-stop { text-align: center; margin-top: 1.6rem; }
.tt-sizes { justify-content: center; }
@media (max-width: 46rem) {
  .tt-table { grid-template-columns: minmax(0, 23rem); }
  /* on a phone the computer's card waits underneath until it is turned over */
  .tt-slot--cpu .vc-down { aspect-ratio: auto; }
  .tt-slot--cpu .vc-down .down-in { flex-direction: row; padding: .7rem 1rem; gap: .8rem; }
  .tt-slot--cpu .vc-down svg { width: 1.6rem; }
  .tt-slot--cpu .vc-down .down-t br { display: none; }
  .tt-slot--cpu .vc-down .down-t { font-size: 1rem; margin: 0; }
  .tt-slot--cpu .vc-down .down-who { margin: 0 0 0 auto; text-align: right; }
}

/* ---------------------------------------------------------- the card */
.vc { container-type: inline-size; width: 100%; }
.vc-face { --ink: #1d1b19; --paper: #fbf7ef; --rule: #ddd3c2; --label: #6b5f4f;
           position: relative; width: 100%; aspect-ratio: 64 / 89; background: var(--paper); color: var(--ink);
           font-family: "Source Sans 3", var(--sans); font-variant-numeric: normal; line-height: 1.2;
           display: flex; flex-direction: column; overflow: hidden; text-align: left;
           border-radius: 3.6cqw; box-shadow: 0 1px 2px rgba(22,40,60,.18), 0 6px 18px rgba(22,40,60,.12); }
.vc-face::after { content: ""; position: absolute; inset: 1.72cqw; border: .78cqw solid var(--cat); border-radius: 3.75cqw; pointer-events: none; }
.vc-face .band { background: var(--cat); color: #fff; margin: 1.72cqw 1.72cqw 0; border-radius: 3.75cqw 3.75cqw 0 0;
                 padding: 1.4cqw 3.6cqw; display: flex; justify-content: space-between; align-items: center;
                 font-size: 3.3cqw; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.vc-face .band .num { font-weight: 600; letter-spacing: 0; opacity: .9; }
.vc-face .foot { margin-top: 0; padding: 0 4.4cqw 3.1cqw; display: flex; justify-content: space-between; font-size: 2.6cqw; color: #8a7f70; }

.vc-front .head { text-align: center; padding: 3.4cqw 4.7cqw 0; }
.vc-front .word { font-family: "Cormorant Garamond", var(--serif); font-weight: 700; font-size: 16.5cqw; line-height: .9; }
.vc-front .word.long { font-size: 12.7cqw; }
.vc-front .dict { font-style: italic; font-size: 4.4cqw; color: var(--label); margin-top: 1.56cqw; }
.vc-front .gram { margin: 4.06cqw 4.7cqw 0; border-collapse: collapse; font-size: 4.08cqw; line-height: 1.2; width: calc(100% - 9.4cqw); }
.vc-front .gram td { padding: 1.25cqw 0; border-bottom: .31cqw solid var(--rule); vertical-align: top; }
.vc-front .gram tr:first-child td { border-top: .31cqw solid var(--rule); }
.vc-front .gram td.k { color: var(--label); font-weight: 700; text-transform: uppercase; font-size: 3.09cqw; letter-spacing: .05em; width: 26.6cqw; padding-top: 1.5cqw; }
.vc-front .gram .pl { color: var(--label); font-size: 3.47cqw; font-style: normal; }
.vc-front .stats { margin: auto 4.06cqw 2cqw; background: var(--cat); color: #fff; border-radius: 2.5cqw; padding: 2cqw 3.1cqw 2.3cqw; }
.vc-front .st-title { font-size: 2.87cqw; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; margin-bottom: .94cqw; }
.vc-front .st-title .lik { text-transform: none; letter-spacing: 0; font-weight: 600; }
.vc-front .st-title .lik b { font-weight: 800; }
.vc-front .st { display: grid; grid-template-columns: 34.4cqw 9.4cqw 1fr; align-items: center; gap: 1.9cqw; width: 100%;
                font: inherit; font-size: 3.64cqw; color: inherit; text-align: left; background: none; border: 0;
                padding: .9cqw .8cqw; margin: 0 -.8cqw; width: calc(100% + 1.6cqw); border-top: .31cqw solid rgba(255,255,255,.25); border-radius: 0; }
.vc-front .sk { font-weight: 600; }
.vc-front .sv { font-weight: 800; text-align: right; font-size: 4.19cqw; }
.vc-front .bar { height: 2.34cqw; background: rgba(255,255,255,.25); border-radius: 1.6cqw; overflow: hidden; display: block; }
.vc-front .bar span { display: block; height: 100%; background: #fff; border-radius: 1.6cqw; }
.vc-front .st--pick { cursor: pointer; }
.vc-front .st--pick:hover, .vc-front .st--pick:focus-visible { background: rgba(255,255,255,.18); outline: none; border-radius: 1.2cqw; }
.vc-front .st.is-hl { background: #fff; color: var(--cat); border-radius: 1.2cqw; }
.vc-front .st.is-hl .bar { background: rgba(0,0,0,.12); }
.vc-front .st.is-hl .bar span { background: var(--cat); }

.vc-back .meaning { text-align: center; font-weight: 800; color: var(--cat); font-size: 7.7cqw; line-height: 1.05; padding: 2.5cqw 4.7cqw 1.9cqw; }
.vc-back .photo { margin: 0 4.06cqw; height: 54.7cqw; position: relative; border: .47cqw solid var(--cat); flex: none; background: #e9e1d2; }
.vc-back .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vc-back .photo .cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.58); color: #fff; font-size: 2.87cqw; padding: .63cqw 2cqw; font-style: italic; line-height: 1.2; }
.vc-back .photo .credit { position: absolute; top: 0; right: 0; max-width: 100%; background: rgba(0,0,0,.5); color: #fff; font-size: 2.15cqw;
                          line-height: 1.2; padding: .4cqw 1.56cqw; border-bottom-left-radius: 1.25cqw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-back .photo.none { background: repeating-linear-gradient(45deg, #eee5d5 0 3cqw, #f6efe2 3cqw 6cqw); }
.vc-back .row { margin: 2cqw 4.4cqw 0; font-size: 3.86cqw; line-height: 1.2; }
.vc-back .row .k { color: var(--label); font-weight: 700; text-transform: uppercase; font-size: 2.81cqw; letter-spacing: .05em; }
.vc-back .ex { margin: 2cqw 4.06cqw 0; padding: 1.56cqw 2.34cqw; border: .31cqw solid var(--rule); border-radius: 1.9cqw; background: #fff; font-size: 3.86cqw; line-height: 1.22; }
.vc-back .ex .la { font-style: italic; }
.vc-back .ex .la b { font-weight: 700; color: var(--cat); }
.vc-back .ex .en { margin-top: .8cqw; }
.vc-back .ex .en b { color: var(--cat); }
.vc-back .tip { margin: 2cqw 4.06cqw 0; background: #f1e6cf; border-left: 1.25cqw solid var(--cat); padding: 1.25cqw 2.19cqw; font-size: 3.75cqw; line-height: 1.2; }
.vc-back .tip b { color: var(--cat); }
.vc-back .brand { margin-top: auto; padding: 0 4.5cqw 3.3cqw; display: flex; align-items: center; gap: 1.7cqw; color: var(--cat); }
.vc-back .brand > svg { height: 7.2cqw; width: auto; flex: none; }
.vc-back .brand .wm { font-family: Jost, var(--name); font-weight: 500; font-size: 3.09cqw; }
.vc-back .brand .url { margin-left: auto; font-size: 2.76cqw; font-weight: 600; color: var(--label); white-space: nowrap; }

.vc-down { background: var(--ink); color: #fff; }
.vc-down::after { display: none; }
.vc-down .down-in { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8cqw;
                    background: radial-gradient(circle at 50% 38%, rgba(200,136,46,.28), transparent 60%); }
.vc-down svg { width: 26cqw; height: auto; color: #fff; }
.vc-down .down-t { font-family: var(--serif); font-size: 9cqw; line-height: 1.05; margin: 4cqw 0 3cqw; }
.vc-down .down-who { font-family: var(--sans); font-size: 4cqw; color: #C9D5DE; margin: 0; }
.vc-down .down-who b { color: #fff; font-size: 1.4em; }

/* turning a card over */
.flip { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1600px; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.flip-in { display: grid; transition: transform .55s cubic-bezier(.3,.7,.3,1); transform-style: preserve-3d; }
.flip-in > .vc-face { grid-area: 1 / 1; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.flip-in > .vc-back { transform: rotateY(180deg); }
.flip.is-flipped .flip-in { transform: rotateY(180deg); }
.flip:focus-visible { outline: 3px solid var(--honey); outline-offset: 4px; border-radius: 4cqw; }
@media (prefers-reduced-motion: reduce) { .flip-in { transition: none; } }

/* ---------------------------------------------------------- installed as an app */
.vg-appbar { display: none; }
.is-app .site-head, .is-app .site-foot, .is-app .page-head { display: none; }
.is-app .vg-appbar { display: flex; align-items: center; gap: .6rem; padding: calc(env(safe-area-inset-top) + .7rem) var(--gutter) .7rem;
                     background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 5; }
.is-app .vg-appbar > svg { width: 1.5rem; height: auto; }
.is-app .vg-appbar .wm { font-size: .82rem; }
.is-app .vg { padding-top: 1.2rem; padding-bottom: calc(env(safe-area-inset-bottom) + 2rem); }
