/* Higher or lower: two tiles with the picture of a card, the one to tap, the reveal and the result. It builds on
   card-tournament.css (ct-*). Made for a phone first: the tiles stack, each is a big target, nothing needs a small button. */

.hl { scroll-margin-top: 5rem; }
.hl-play { gap: 1rem; }
.hl-top { display: flex; align-items: center; gap: 0.7rem 1rem; flex-wrap: wrap; }
.hl-streak { color: var(--ct-muted); font-size: 0.95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hl-streak b { color: var(--ct-gold); font-size: 1.6rem; margin-left: 0.2rem; }
.hl-format { color: var(--ct-lilac); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.hl-leave { margin-left: auto; min-height: 40px; padding: 0 0.95rem; font-size: 0.86rem; }
.hl-leave.is-sure { background: #3a1519; border-color: #f87171; color: #ffd9de; }
.hl-q { margin: 0; text-align: center; font-size: clamp(1.1rem, 3.6vw, 1.45rem); font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }

/* the two tiles */
.hl-arena { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.9rem; }
.hl-tile { position: relative; display: block; overflow: hidden; isolation: isolate; min-height: clamp(21rem, 52vh, 30rem); padding: 0; border-radius: 22px; border: 2px solid rgba(255, 255, 255, 0.12); background: linear-gradient(165deg, #241743, #120d1b); color: #fff; font: inherit; text-align: center; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, opacity 0.2s ease; }
.hl-tile__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
/* a dark veil under the words, so the name and the number read on any picture */
.hl-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 6, 18, 0.35) 0%, rgba(10, 6, 18, 0.2) 30%, rgba(10, 6, 18, 0.88) 78%, rgba(10, 6, 18, 0.96) 100%); }
.hl-tile__body { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 1.1rem 1rem 1.2rem; }
.hl-tile__name { font-size: clamp(1.3rem, 4.2vw, 1.9rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; overflow-wrap: anywhere; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
.hl-tile .hl-pips { position: absolute; top: 0.8rem; left: 0.8rem; z-index: 1; }
.hl-tile__card { position: absolute; right: 0.7rem; top: 0.9rem; max-width: 55%; font-size: 0.66rem; font-weight: 600; color: rgba(255, 255, 255, 0.72); text-align: right; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); overflow-wrap: anywhere; }

.hl-rate { display: flex; align-items: baseline; justify-content: center; gap: 0.15rem; }
.hl-rate b { font-size: clamp(3.2rem, 11vw, 5rem); line-height: 1; font-weight: 800; color: var(--ct-gold); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; text-shadow: 0 3px 18px rgba(0, 0, 0, 0.6); }
.hl-rate small { font-size: 1.4rem; font-weight: 800; color: #d9d2ec; }
.hl-tile--hidden:not(.is-revealed) .hl-rate b { color: #b9afd8; }
.hl-sub { min-height: 1.1em; color: #cfc6e6; font-size: 0.78rem; font-weight: 600; }

.hl-vs { position: absolute; left: 50%; top: 50%; z-index: 3; width: 3.1rem; height: 3.1rem; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; background: var(--ct-violet); border: 3px solid var(--ct-card); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); pointer-events: none; }
.hl-vs span { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; }

/* a tile you can tap */
.hl-tile:hover:not(.is-locked) { border-color: var(--ct-violet-soft); box-shadow: 0 0 0 1px var(--ct-violet-soft), 0 14px 34px rgba(122, 66, 238, 0.3); transform: translateY(-3px); }
.hl-tile:active:not(.is-locked) { transform: scale(0.985); }
.hl-tile:focus-visible { outline: 3px solid #d998ff; outline-offset: 3px; }
.hl-tile.is-locked { cursor: default; }

/* after the answer: the tile you tapped says if you were right, the other one steps back */
.hl-tile.is-locked:not(.is-picked) { opacity: 0.72; }
.hl-tile.is-picked.is-right { border-color: var(--ct-green); box-shadow: 0 0 0 2px var(--ct-green), 0 14px 38px rgba(74, 222, 128, 0.25); }
.hl-tile.is-picked.is-wrong { border-color: #f87171; box-shadow: 0 0 0 2px #f87171, 0 14px 38px rgba(248, 113, 113, 0.25); }
.hl-tile__mark { position: absolute; left: 50%; top: 42%; z-index: 2; display: grid; place-items: center; width: 4.4rem; height: 4.4rem; border-radius: 50%; font-size: 2rem; transform: translate(-50%, -50%) scale(0.6); opacity: 0; transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.2s ease; pointer-events: none; }
.hl-tile.is-picked .hl-tile__mark { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hl-tile.is-picked.is-right .hl-tile__mark { background: var(--ct-green); color: #052e16; box-shadow: 0 10px 30px rgba(74, 222, 128, 0.45); }
.hl-tile.is-picked.is-wrong .hl-tile__mark { background: #f87171; color: #3a1519; box-shadow: 0 10px 30px rgba(248, 113, 113, 0.45); }

.hl-verdict { text-align: center; font-size: 1.1rem; font-weight: 800; }
.hl-verdict.is-right { color: var(--ct-green); }
.hl-verdict.is-wrong { color: #fca5a5; }
.hl-switched { padding: 0.6rem 0.9rem; border-radius: 10px; background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.3); color: #f6dd9a; }

/* the colours of an archetype */
.hl-pips { display: flex; justify-content: center; gap: 0.3rem; min-height: 1.4rem; }
.hl-pip { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; font-size: 0.72rem; font-weight: 800; color: #1a1420; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 -2px 3px rgba(0, 0, 0, 0.25); }
.hl-pip--W { background: #f6efc9; }
.hl-pip--U { background: #6bb4ee; }
.hl-pip--B { background: #8a7a9c; color: #fff; }
.hl-pip--R { background: #ec6a5e; }
.hl-pip--G { background: #5fbf79; }

/* a new round: the tile that arrives slides in from the right, the one that stays only blinks */
.hl-tile.is-entering { animation: hl-in 0.35s ease; }
.hl-tile.is-moved { animation: hl-moved 0.3s ease; }
@keyframes hl-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes hl-moved { from { opacity: 0.4; } to { opacity: 1; } }

/* the result */
.hl-result { gap: 1.2rem; }
.hl-result__head { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.hl-result__head h2 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -0.02em; }
.hl-big { display: flex; align-items: baseline; gap: 0.7rem; }
.hl-big b { font-size: clamp(3.4rem, 12vw, 5.5rem); line-height: 1; font-weight: 800; color: var(--ct-gold); font-variant-numeric: tabular-nums; }
.hl-big small { color: var(--ct-muted); font-weight: 700; }
.hl-missed { color: #fca5a5; }
.hl-review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; max-height: 24rem; overflow-y: auto; overscroll-behavior: contain; }
.hl-review li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; padding: 0.5rem 0.8rem; border-radius: 12px; background: #120d1b; border: 1px solid rgba(255, 255, 255, 0.07); font-size: 0.88rem; }
.hl-review li.is-right i { color: var(--ct-green); }
.hl-review li.is-wrong i { color: #f87171; }
.hl-review span { overflow-wrap: anywhere; font-weight: 600; }
.hl-review small { display: block; color: var(--ct-muted); font-weight: 600; }
.hl-review b { color: var(--ct-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hl-canvas { display: none; }
.hl-signup { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 1.2rem; border-radius: 16px; background: linear-gradient(135deg, rgba(122, 66, 238, 0.25), rgba(251, 191, 36, 0.08)); border: 1px solid rgba(167, 123, 255, 0.35); }
.hl-signup > i { font-size: 1.5rem; color: var(--ct-gold); }
.hl-signup div { flex: 1 1 14rem; min-width: 0; }
.hl-signup p { margin: 0.15rem 0 0; color: #cfc6e6; font-size: 0.9rem; }

@media (max-width: 720px) {
    /* one over the other, both in view on a phone: each tile takes a bit more than a third of the screen */
    .hl-arena { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
    .hl-tile { min-height: clamp(10.5rem, 29vh, 15rem); }
    .hl-tile__body { gap: 0.15rem; padding: 0.8rem 0.9rem 0.9rem; }
    .hl-tile__name { font-size: 1.25rem; }
    .hl-rate b { font-size: clamp(2.6rem, 14vw, 3.4rem); }
    .hl-rate small { font-size: 1.1rem; }
    .hl-sub { min-height: 0; font-size: 0.72rem; }
    .hl-tile__mark { top: 36%; width: 3.6rem; height: 3.6rem; font-size: 1.6rem; }
    .hl-vs { width: 2.7rem; height: 2.7rem; }
    .hl-leave { margin-left: 0; width: 100%; }
    /* the formats: three to a row on a phone */
    .hl-formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
    .hl-formats .ct-chip { min-width: 0; padding: 0.5rem 0.3rem; align-items: center; text-align: center; }
    .hl-formats .ct-chip b { font-size: 0.86rem; overflow-wrap: anywhere; }
    .hl-formats .ct-chip small { font-size: 0.62rem; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
    .hl-tile.is-entering, .hl-tile.is-moved { animation: none; }
    .hl-tile, .hl-tile__img, .hl-tile__mark { transition: none; }
}
