/* The multiplayer game: the phones (.lv-phone) and the big screen (.lv-screen). Plain CSS, no framework: light on a phone. */
/* A playful look: chunky rounded buttons with a ledge, bright colours, small animations. Dark, for a projector. */
:root { --c0: #ff4b4b; --c1: #1cb0f6; --c2: #ff9600; --c3: #ce82ff;      /* the four proposals */
        --c0d: #ea2b2b; --c1d: #1899d6; --c2d: #cc7900; --c3d: #a568cc;  /* their ledge */
        --green: #58cc02; --greend: #58a700; --red: #ff4b4b; --redd: #ea2b2b; --yellow: #ffc800;
        --bg: #131f24; --panel: #1f2c34; --line: #37464f; --fg: #fff; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg);
             font-family: ui-rounded, "Nunito", "Varela Round", "Segoe UI", system-ui, sans-serif; }
a { color: #49c0f8; }
h1, h2 { margin: .3em 0; }
.lv-wrap { max-width: 520px; margin: 0 auto; padding: 16px; }
.lv-card { background: var(--panel); color: var(--fg); border: 2px solid var(--line); border-radius: 20px;
           padding: 16px; margin: 12px 0; }
.lv-card label { display: block; margin: 10px 0 4px; font-weight: 700; }
.lv-card input, .lv-card select { width: 100%; font-size: 18px; padding: 10px 12px; border: 2px solid var(--line);
                                  border-radius: 14px; background: var(--bg); color: var(--fg); }
.lv-card input[type=checkbox] { width: auto; margin-right: 8px; }
.lv-btn { display: block; width: 100%; font-size: 20px; font-weight: 800; padding: 14px; border: 0; border-radius: 16px;
          background: var(--green); color: #fff; cursor: pointer; margin-top: 14px; text-transform: none;
          letter-spacing: 0; box-shadow: 0 5px 0 var(--greend); transition: transform .08s, box-shadow .08s; }
.lv-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--greend); }
.lv-btn:disabled { background: var(--line); color: #6b7f88; box-shadow: 0 5px 0 #2b3a42; cursor: default; }
.lv-error { background: #ffd6d6; color: #7a0000; padding: 10px 14px; border-radius: 14px; margin: 10px 0; font-weight: 700; }
.lv-note { opacity: .8; }

/* the four proposals: a colour and a shape each, so they are told apart without reading */
.lv-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lv-choice { position: relative; min-height: 96px; padding: 12px; border: 0; border-radius: 16px; color: #fff;
             font-size: 18px; font-weight: 800; line-height: 1.2; text-align: left; cursor: pointer;
             display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
             transition: transform .08s, box-shadow .08s, opacity .2s; }
.lv-choice[data-i="0"] { background: var(--c0); box-shadow: 0 6px 0 var(--c0d); }
.lv-choice[data-i="1"] { background: var(--c1); box-shadow: 0 6px 0 var(--c1d); }
.lv-choice[data-i="2"] { background: var(--c2); box-shadow: 0 6px 0 var(--c2d); }
.lv-choice[data-i="3"] { background: var(--c3); box-shadow: 0 6px 0 var(--c3d); }
button.lv-choice:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.lv-choice .shape { font-size: 26px; flex: none; }
.lv-choice > span:not(.shape):not(.count) { white-space: nowrap; }  /* a name stays on one line: live-fx.js shrinks it */
/* on a phone the proposals are stacked, so that a name has the whole width */
.lv-phone .lv-choices { grid-template-columns: 1fr; gap: 6px; }
.lv-phone .lv-choice { min-height: 64px; }
.lv-choice.dim { opacity: .3; box-shadow: none; }
.lv-choice.right { outline: 5px solid #fff; animation: pop .5s ease-out; }
.lv-choice.right::after { content: "\2713"; position: absolute; top: 6px; right: 12px; font-size: 26px; }
.lv-choice.picked::after { content: "\2713"; position: absolute; top: 6px; right: 10px; font-size: 22px; }
.lv-choice .count { margin-left: auto; font-size: 26px; }

.lv-timer { height: 16px; background: var(--line); border-radius: 8px; overflow: hidden; margin: 10px 0; }
.lv-timer > div { height: 100%; width: 100%; background: var(--green); border-radius: 8px;
                  transition: width .25s linear, background-color .5s; }
.lv-timer > div.mid { background: var(--yellow); } .lv-timer > div.low { background: var(--red); }
.lv-big { font-size: 28px; font-weight: 800; text-align: center; margin: 24px 0 8px; }
.lv-good { color: #7dff7d; } .lv-bad { color: #ff9090; }

/* the result on a phone: a panel that springs up, with a ledge */
.lv-feedback { border-radius: 20px; padding: 6px 18px 18px; margin-top: 16px; text-align: center;
               animation: spring .5s cubic-bezier(.2, 1.3, .4, 1) backwards; }
.lv-feedback.good { background: var(--green); box-shadow: 0 6px 0 var(--greend); }
.lv-feedback.bad { background: var(--red); box-shadow: 0 6px 0 var(--redd); }
.lv-feedback.none { background: var(--line); box-shadow: 0 6px 0 #2b3a42; }
.lv-feedback .lv-big, .lv-feedback .lv-good, .lv-feedback .lv-bad { color: #fff; margin-top: 16px; }
.lv-feedback p { margin: 6px 0 0; font-weight: 700; }

/* what appears with a new screen rises, one piece after the other */
#main.enter > * { animation: rise .4s ease-out backwards; }
#main.enter > *:nth-child(2) { animation-delay: .06s; } #main.enter > *:nth-child(3) { animation-delay: .12s; }
#main.enter > *:nth-child(4) { animation-delay: .18s; } #main.enter > *:nth-child(5) { animation-delay: .24s; }
#main.enter .lv-choice:nth-child(2) { animation: rise .4s .08s ease-out backwards; }
#main.enter .lv-choice:nth-child(3) { animation: rise .4s .16s ease-out backwards; }
#main.enter .lv-choice:nth-child(4) { animation: rise .4s .24s ease-out backwards; }

#main.enter > .lv-feedback { animation: spring .5s cubic-bezier(.2, 1.3, .4, 1) backwards; }
#main.enter .lv-choice.right { animation: pop .5s .45s ease-out backwards; }

.lv-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.lv-confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; opacity: 0;
                 animation: fall 2.6s ease-in forwards; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes spring { from { opacity: 0; transform: translateY(40px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes pop { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.06); } }
@keyframes fall {
    0% { opacity: 1; transform: translateY(0) rotate(0); }
    100% { opacity: 1; transform: translateY(105vh) rotate(720deg); }
}
@media (prefers-reduced-motion: reduce) {
    #main.enter > *, #main.enter .lv-choice, .lv-feedback, .lv-choice.right { animation: none !important; }
    .lv-confetti { display: none; }
}
.lv-board { width: 100%; border-collapse: collapse; font-size: 20px; }
.lv-board td { padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.2); }
.lv-board td:last-child { text-align: right; font-weight: 700; }
.lv-board tr.me { background: rgba(255,200,0,.3); }

/* the big screen */
.lv-screen { padding: 20px 32px; max-width: 1400px; margin: 0 auto; }
.lv-screen .lv-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.lv-screen .lv-code { font-size: 64px; font-weight: 900; letter-spacing: .12em; background: var(--panel);
                      border: 2px solid var(--line); border-radius: 20px; padding: 0 24px; box-shadow: 0 5px 0 var(--line); }
.lv-lobby { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; margin-top: 20px; }
.lv-lobby .qr { background: #fff; padding: 12px; border-radius: 20px; width: min(420px, 90vw); }
.lv-lobby .qr img { width: 100%; display: block; }
.lv-names { flex: 1; min-width: 300px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.lv-names span { background: var(--panel); border: 2px solid var(--line); padding: 4px 14px; border-radius: 20px;
                 font-size: 20px; font-weight: 700; }
.lv-photo-box { position: relative; overflow: hidden; margin: 10px 0; border-radius: 10px; background: #000; }
.lv-photo { display: block; width: 100%; max-height: 32vh; object-fit: contain; transition: transform .2s linear; }
.lv-qbox .pic { overflow: hidden; border-radius: 12px; }
.lv-qbox .pic img { transition: transform .2s linear; display: block; }
/* the checkerboard hiding a photo: two colours, squares that fade away */
.lv-checker { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; pointer-events: none; }
.lv-tile { transition: opacity .4s, transform .4s; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.lv-tile.a { background: #1f2c34; } .lv-tile.b { background: #2f4350; }
.lv-tile.open { opacity: 0; transform: scale(.6); }
.lv-qbox .pic { position: relative; }
.lv-over { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
/* Opacity of the background of the names: 0.75 is a background transparent at 25% */
.lv-species { padding: 8px 16px; border-radius: 8px; background: rgba(0, 0, 0, .75); color: #fff; line-height: 1.25; }
.lv-species .group { font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); }
.lv-species .common { font-size: 30px; font-weight: bold; }
.lv-species .vernacular { font-size: 22px; }
.lv-species .latin { font-size: 22px; font-style: italic; }
.lv-links { display: flex; gap: 10px; font-size: 22px; }
.lv-links a { padding: 6px 14px; border-radius: 8px; background: rgba(0, 0, 0, .7); color: #fff; text-decoration: none; }
.lv-links a:hover { background: rgba(0, 0, 0, .9); text-decoration: underline; }
.lv-qbox { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.lv-qbox .pic { flex: 1 1 600px; min-width: 0; }
.lv-qbox .pic img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 12px; background: #000; }
.lv-qbox .side { flex: 1 1 360px; }
.lv-screen .lv-choices { grid-template-columns: 1fr 1fr; margin-top: 16px; }
.lv-screen .lv-choice { cursor: default; font-size: 26px; min-height: 90px; }
.lv-screen .lv-btn { width: auto; display: inline-block; padding: 12px 28px; }
.lv-podium { display: flex; justify-content: center; align-items: flex-end; gap: 16px; margin: 24px 0; }
.lv-podium div { background: var(--panel); border: 2px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0;
                 padding: 12px 20px; text-align: center; min-width: 160px; animation: rise .7s cubic-bezier(.2, 1.2, .4, 1) backwards; }
.lv-podium .p1 { height: 200px; background: var(--yellow); border-color: #e0a800; color: #3c3c3c; animation-delay: 1s; }
.lv-podium .p2 { height: 150px; animation-delay: .6s; } .lv-podium .p3 { height: 110px; animation-delay: .2s; }
.lv-podium b { display: block; font-size: 26px; }
