/* The moving scenes (includes/loop_scenes.php, js/loops.js). Every rule without .is-live is the finished picture, which is
   what a visitor sees with scripts off or with reduced motion asked for. The rules with .is-live take it back to the start. */

.loop {
    --cx: 70%; --cy: 92%;
    position: relative; margin: 0; overflow: hidden; color: var(--gray-900); text-align: left; font-size: 0.88rem; line-height: 1.3;
    background: var(--white); border-radius: 14px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
}
.loop__bar { display: flex; align-items: center; gap: 6px; padding: 9px 13px; background: var(--gray-100); border-bottom: 1px solid var(--gray-200); }
.loop__bar i { width: 9px; height: 9px; background: var(--gray-300); border-radius: 50%; }
.loop__bar span { margin-left: 8px; font-size: 0.8rem; font-weight: 600; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loop__body { position: relative; display: flex; flex-direction: column; gap: 9px; min-height: 268px; padding: 15px; transition: opacity 0.4s ease; }
.loop.is-resetting .loop__body { opacity: 0; }

/* The pointer and its click. Hidden until the scene is playing. */
.loop__cursor {
    position: absolute; z-index: 3; left: var(--cx); top: var(--cy); opacity: 0; fill: var(--primary-navy); stroke: var(--white); stroke-width: 1.6;
    filter: drop-shadow(0 2px 3px rgba(15, 38, 66, 0.4)); transition: left 0.7s cubic-bezier(0.55, 0, 0.2, 1), top 0.7s cubic-bezier(0.55, 0, 0.2, 1), opacity 0.25s ease;
}
.loop.is-live .loop__cursor { opacity: 1; }
.loop__ring {
    position: absolute; z-index: 2; left: var(--cx); top: var(--cy); width: 40px; height: 40px; margin: -18px 0 0 -18px; opacity: 0; pointer-events: none;
    border: 3px solid var(--primary-green); border-radius: 50%;
}
.loop__ring.is-click { animation: loop-ring 0.7s ease-out; }
@keyframes loop-ring { from { opacity: 0.9; transform: scale(0.35); } to { opacity: 0; transform: scale(1.2); } }

/* Anything with a time comes in at that time, unless it is there from the start. */
[data-at] { transition: opacity 0.3s ease, translate 0.3s ease; }
.loop.is-live [data-at]:not([data-keep]):not(.is-on) { opacity: 0; translate: 0 8px; }

/* A flip shows its last face. While the scene plays it shows the first until its time comes. */
.lp-flip { position: relative; display: inline-grid; }
.lp-flip > * { grid-area: 1 / 1; text-align: center; transition: opacity 0.25s ease; }
.lp-flip > *:not(:last-child) { opacity: 0; }
.loop.is-live .lp-flip:not(.is-on) > *:first-child { opacity: 1; }
.loop.is-live .lp-flip:not(.is-on) > *:not(:first-child) { opacity: 0; }
.loop.is-live .lp-flip--three.is-on:not(.is-on2) > *:nth-child(2) { opacity: 1; }
.loop.is-live .lp-flip--three.is-on:not(.is-on2) > *:nth-child(3) { opacity: 0; }

/* The parts scenes are built from. */
.lp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lp-head b { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; line-height: 1.1; text-transform: uppercase; color: var(--primary-navy); }
.lp-head > span { font-size: 0.82rem; color: var(--gray-600); }
.lp-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gray-600); }
.lp-input { display: block; min-height: 34px; padding: 8px 10px; color: var(--primary-navy); background: var(--white); border: 1px solid var(--gray-300); border-radius: 7px; }
.lp-input--tall { min-height: 54px; }
.lp-input--sign { font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", cursive; font-size: 1.15rem; }
.lp-btn { display: block; padding: 9px 12px; font-weight: 700; text-align: center; color: var(--white); background: var(--primary-green); border-radius: 7px; }
.lp-btn--sm { flex-shrink: 0; padding: 8px 12px; }
.loop [data-at].lp-btn.is-on { background: var(--primary-green-dark); }
.lp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lp-col { display: flex; flex-direction: column; gap: 8px; }
.lp-series { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lp-series .lp-input { flex: 1; min-width: 0; }
.lp-chips { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; }
.lp-chips i { padding: 4px 8px; font-size: 0.78rem; font-style: normal; font-weight: 600; color: var(--primary-navy); background: var(--primary-green-light); border-radius: var(--radius-pill); }
.lp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: 8px; }
.lp-row b { flex: 1; min-width: 0; font-weight: 600; color: var(--primary-navy); }
.lp-row em { font-style: normal; color: var(--gray-600); white-space: nowrap; }
.lp-row--stack { display: block; }
.lp-row--stack b, .lp-row--stack em { display: block; white-space: normal; }
.lp-row--hi { border-color: var(--primary-green); background: #f1f8ec; }
.lp-pill { flex-shrink: 0; padding: 4px 9px; font-size: 0.78rem; font-weight: 700; line-height: 1.1; color: #3f6b26; background: var(--primary-green-light); border-radius: var(--radius-pill); }
.lp-pill i { font-style: normal; }
.lp-pill .is-off { color: var(--gray-600); }
.lp-note { font-size: 0.84rem; font-weight: 600; color: var(--primary-green-dark); }
.lp-stats { display: flex; justify-content: space-between; gap: 14px; }
.lp-stats > span { display: flex; flex-direction: column; gap: 2px; }
.lp-stats em { font-size: 0.78rem; font-style: normal; color: var(--gray-600); }
.lp-stats b { font-weight: 700; color: var(--primary-navy); }
.lp-stats .lp-big, .lp-big { font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--primary-green-dark); font-variant-numeric: tabular-nums; }
.lp-stats--line { margin-top: auto; }
.lp-meter { position: relative; display: block; flex-shrink: 0; height: 10px; overflow: hidden; background: var(--gray-200); border-radius: 5px; }
.lp-meter i { display: block; width: var(--w); height: 100%; background: var(--primary-green); border-radius: 5px; transition: width 0.7s ease; }
.loop.is-live .lp-meter i:not(.is-on) { width: var(--from); }
.lp-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.lp-dow { font-size: 0.68rem; font-weight: 700; text-align: center; color: var(--gray-600); }
.lp-day { min-height: 39px; padding: 2px; font-size: 0.66rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 4px; }
.lp-day--none { background: transparent; border-color: transparent; }
.lp-day b { display: block; font-weight: 600; color: var(--gray-600); }
.lp-chip { display: block; overflow: hidden; font-size: 0.56rem; font-style: normal; font-weight: 700; line-height: 1.4; text-align: center; color: #166534; background: #dcfce7; border-radius: 3px; }
.lp-chip--game { color: #1e40af; background: #dbeafe; }
.lp-seats { display: grid; grid-template-columns: minmax(0, 1fr) auto repeat(4, 18px); align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--gray-200); border-radius: 8px; }
.lp-seats b { font-weight: 600; color: var(--primary-navy); }
.lp-seats em { font-style: normal; color: var(--gray-600); }
.lp-seat { display: block; width: 18px; height: 18px; background: var(--gray-200); border-radius: 5px; }
.lp-seat.is-taken { background: var(--primary-green); }
.lp-seat.lp-flip { display: grid; background: transparent; }
.lp-seat u { display: block; width: 18px; height: 18px; background: var(--gray-200); border-radius: 5px; }
.lp-seat u.is-taken { background: var(--primary-green); }
.lp-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border: 1px solid var(--gray-200); border-radius: 8px; }
.lp-switch b { font-weight: 600; color: var(--primary-navy); }
.lp-switch i { position: relative; flex-shrink: 0; width: 34px; height: 19px; background: var(--gray-300); border-radius: 10px; transition: background 0.2s ease; }
.lp-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; background: var(--white); border-radius: 50%; transition: transform 0.2s ease; }
.lp-switch.is-on-for-good i { background: var(--primary-green); }
.lp-switch.is-on-for-good i::after { transform: translateX(15px); }
.loop.is-live .lp-switch.is-on-for-good:not(.is-on) i { background: var(--gray-300); }
.loop.is-live .lp-switch.is-on-for-good:not(.is-on) i::after { transform: none; }
.lp-lines { display: flex; flex-direction: column; gap: 7px; padding: 4px 0; }
.lp-lines i { display: block; height: 8px; background: var(--gray-200); border-radius: 4px; }
.lp-site { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lp-block { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: 7px; }
.lp-block b { font-weight: 600; color: var(--primary-navy); }
.lp-block em { font-style: normal; color: var(--gray-600); }
.lp-block--hero { padding: 16px 12px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; text-transform: uppercase; color: var(--white); background: var(--primary-navy); border: 0; }
.lp-block--gallery i { flex: 1; height: 28px; background: var(--primary-green-light); border-radius: 4px; }
.lp-squares { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.lp-squares--month { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.lp-sq { display: grid; place-items: center; min-height: 36px; font-size: 0.8rem; font-weight: 600; color: var(--primary-navy); background: var(--white); border: 1px solid var(--gray-300); border-radius: 6px; }
.lp-squares--month .lp-sq { min-height: 29px; font-size: 0.68rem; border-radius: 4px; }
.lp-sq--none { background: transparent; border-color: transparent; }
.lp-sq.lp-flip { display: grid; padding: 0; overflow: hidden; }
.lp-sq.lp-flip > i { display: grid; place-items: center; width: 100%; height: 100%; font-style: normal; }
.lp-sq .is-held { color: #92400e; background: #fffbeb; }
.lp-sq .is-taken { color: var(--white); background: var(--primary-navy); }
.lp-goal { display: flex; flex-direction: column; justify-content: center; gap: 16px; flex: 1; }
.lp-tube { display: block; height: 24px; overflow: hidden; background: var(--gray-200); border-radius: 12px; }
.lp-tube i { display: block; width: var(--w); height: 100%; background: linear-gradient(90deg, var(--primary-green), var(--chalk-lime)); border-radius: 12px; transition: width 3.4s cubic-bezier(0.2, 0.7, 0.3, 1); }
.loop.is-live .lp-tube i:not(.is-on) { width: var(--from); }
.lp-bracket { display: grid; grid-template-columns: 1fr 1fr 0.85fr; align-items: center; gap: 14px; flex: 1; }
.lp-round { display: flex; flex-direction: column; justify-content: space-around; gap: 40px; height: 100%; }
.lp-game { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--gray-300); border-radius: 7px; }
.lp-team { min-height: 31px; padding: 6px 9px; font-weight: 600; color: var(--gray-600); background: var(--white); }
.lp-team + .lp-team { border-top: 1px solid var(--gray-200); }
.lp-team i { font-style: normal; }
.lp-win { color: var(--white); background: var(--primary-navy); transition: background 0.25s ease, color 0.25s ease; }
.loop.is-live .lp-win:not(.is-on) { color: var(--gray-600); background: var(--white); }
.lp-champ { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; text-align: center; background: var(--primary-green-light); border-radius: 8px; }
.lp-champ em { font-size: 0.72rem; font-style: normal; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #3f6b26; }
.lp-champ b { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; text-transform: uppercase; color: var(--primary-navy); }

.lp-tree { position: relative; display: flex; flex-direction: column; padding: 8px 12px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; }
.lp-tree em { font-size: 0.72rem; font-style: normal; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--primary-green-dark); }
.lp-tree b { font-weight: 600; color: var(--primary-navy); }
.lp-tree--1 { margin-left: 28px; }
.lp-tree--2 { margin-left: 56px; }
.lp-tree--3 { margin-left: 84px; background: #f1f8ec; border-color: var(--primary-green); }
.lp-tree--1::before, .lp-tree--2::before, .lp-tree--3::before { content: ""; position: absolute; top: -10px; left: -15px; width: 15px; height: 34px; border-left: 2px solid var(--gray-300); border-bottom: 2px solid var(--gray-300); border-bottom-left-radius: 6px; }
.lp-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lp-photos i { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--primary-green-light), #bfdcaa); border-radius: 6px; }
.lp-photos i:nth-child(2n) { background: linear-gradient(135deg, #dbe7f3, #a9c4de); }
.lp-photos i:nth-child(3n) { background: linear-gradient(135deg, #fbecc8, #efcf8b); }
.lp-dim { opacity: 0.32; }
.loop.is-live .lp-dim:not(.is-on) { opacity: 1; }

/* A feature page: the words on the left, the scene on the right. */
.loop-slot { margin-top: 26px; }
@media (min-width: 1040px) {
    .feature-hero--loop .container { display: grid; grid-template-columns: minmax(0, 1fr) 450px; column-gap: 44px; align-items: center; }
    .feature-hero--loop .container > * { grid-column: 1 / -1; }
    .feature-hero--loop .feature-hero__head { grid-column: 1; }
    .feature-hero--loop .loop-slot { grid-column: 2; grid-row: 2; margin-top: 0; }
}

@media (max-width: 480px) {
    .loop { font-size: 0.82rem; }
    .loop__body { min-height: 0; padding: 12px; }
    .lp-day { min-height: 32px; }
}
