Something went wrong. Try again.
TV-friendly front end for the TimeGuessr daily
Something went wrong. Try again.
14 kB · 569 lines
CSS
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570/* Temporamancer: a 10-foot UI for the TimeGuessr daily. Design rules: the photo owns the screen; everything else floats over it in compact translucent panels kept inside a TV-safe margin. */
:root { --bg: #0b0c10; --panel: rgba(16, 18, 24, 0.82); --panel-strong: rgba(28, 31, 40, 0.95); --panel-border: rgba(255, 255, 255, 0.10); --text: #f3f2ee; --muted: rgba(243, 242, 238, 0.62); --accent: #e0624a; --accent-hover: #ea7a64; --gold: #f3c252; --green: #4cc98a; --radius: 1rem; --safe: max(24px, 2.6vmin); /* TV overscan margin */ --shadow: 0 10px 40px rgba(0, 0, 0, 0.45); --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;}
* { box-sizing: border-box; }
/* Scale type with the viewport so a 1080p TV reads from the couch. */html { font-size: clamp(15px, 1.05vw, 24px); }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden;}
button { font: inherit; color: inherit; cursor: pointer; }[hidden] { display: none !important; }
/* ---------- stage + photo ---------- */#stage { position: fixed; inset: 0; }
#photo-wrap { position: absolute; inset: 0; overflow: hidden; background: var(--bg); touch-action: none;}
#photo { display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: center center; transition: transform 0.12s ease-out, opacity 0.35s ease; opacity: 0; user-select: none; -webkit-user-drag: none;}#photo.ready { opacity: 1; }#photo-wrap.zoomed { cursor: grab; }#photo-wrap.dragging { cursor: grabbing; }#photo-wrap.dragging #photo { transition: none; }
#photo-status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 70vw; padding: 0.8rem 1.4rem; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 999px; font-size: 1.1rem; text-align: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);}
/* ---------- floating panels ---------- */.panel { position: absolute; background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);}
#hud { position: absolute; top: var(--safe); left: var(--safe); display: flex; gap: 0.6rem;}
.chip { display: flex; flex-direction: column; gap: 0.05rem; min-width: 5.5rem; padding: 0.55rem 1rem 0.6rem; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 0.8rem; box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);}.chip-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);}.chip strong { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1;}#hud-score { color: var(--gold); }
#photo-tools { position: absolute; top: var(--safe); right: var(--safe); display: flex; gap: 0.5rem;}
.tool { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; padding: 0; border: 1px solid var(--panel-border); border-radius: 0.8rem; background: var(--panel); box-shadow: var(--shadow); font-size: 1.3rem; font-weight: 600; line-height: 1; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);}.tool:hover { background: var(--panel-strong); }.tool[aria-pressed="true"] { background: var(--accent); border-color: transparent; }.tool:focus-visible, .step:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
/* ---------- year panel ---------- */#year-panel { left: var(--safe); bottom: var(--safe); width: clamp(300px, 24vw, 540px); padding: 1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: 0.6rem;}
.year-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;}
#year-out { min-width: 4ch; font-size: 3.4rem; font-weight: 800; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; line-height: 1; text-align: center;}#year-out.typing { color: var(--gold); }
.step { width: 3rem; height: 3rem; padding: 0; border: 1px solid var(--panel-border); border-radius: 50%; background: rgba(255, 255, 255, 0.06); font-size: 1.1rem; line-height: 1; touch-action: none;}.step:hover { background: rgba(255, 255, 255, 0.14); }.step:active { transform: scale(0.94); }
#year-range { -webkit-appearance: none; appearance: none; width: 100%; height: 2.4rem; margin: 0; background: transparent; cursor: pointer;}#year-range::-webkit-slider-runnable-track { height: 0.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.18);}#year-range::-webkit-slider-thumb { -webkit-appearance: none; width: 1.9rem; height: 1.9rem; margin-top: -0.7rem; border-radius: 50%; border: 3px solid #fff; background: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);}#year-range::-moz-range-track { height: 0.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.18);}#year-range::-moz-range-thumb { width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 3px solid #fff; background: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);}#year-range:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 999px; }
.year-scale { display: flex; justify-content: space-between; margin-top: -0.3rem; font-size: 0.75rem; color: var(--muted);}
#guess-btn { width: 100%; margin-top: 0.2rem; padding: 0.9rem 1rem; border: none; border-radius: 0.8rem; background: var(--accent); color: #fff; font-size: 1.35rem; font-weight: 700; letter-spacing: 0.01em; box-shadow: 0 6px 20px rgba(224, 98, 74, 0.35); transition: transform 0.08s, background 0.15s;}#guess-btn:hover:not(:disabled) { background: var(--accent-hover); }#guess-btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }#guess-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }#guess-btn:disabled { background: rgba(255, 255, 255, 0.12); color: var(--muted); box-shadow: none; cursor: default;}#guess-btn.year-only:not(:disabled) { background: rgba(255, 255, 255, 0.14); color: var(--text); box-shadow: none;}#guess-btn.year-only:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
/* ---------- map panel ---------- */#map-panel { right: var(--safe); bottom: var(--safe); width: clamp(320px, 26vw, 600px); height: clamp(210px, 26vh, 420px); overflow: hidden; transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);}#map-panel.expanded, #map-panel.pinned { width: min(58vw, 1300px); height: min(68vh, 950px);}#map { position: absolute; inset: 0; }#map-pin { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 500; width: 2.2rem; height: 2.2rem; font-size: 1.2rem;}
/* Leaflet tweaks for a dark theme and bigger targets */.leaflet-container { background: #1b1f27; font-family: var(--font); }.leaflet-bar a { width: 2.2rem !important; height: 2.2rem !important; line-height: 2.2rem !important; font-size: 1.3rem !important;}.leaflet-control-attribution { font-size: 0.6rem; opacity: 0.75; }.pin { display: block; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);}.pin-guess { background: var(--accent); }.pin-actual { background: var(--green); }
/* ---------- overlays ---------- */.overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: var(--safe); background: rgba(7, 8, 11, 0.93); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); animation: fade 0.25s ease;}
/* While a results or final overlay is up, the guessing controls underneath are noise. */.phase-results #hud, .phase-results #photo-tools, .phase-results #year-panel, .phase-results #map-panel,.phase-final #hud, .phase-final #photo-tools, .phase-final #year-panel, .phase-final #map-panel { visibility: hidden;}@keyframes fade { from { opacity: 0; } to { opacity: 1; } }.overlay-inner { width: min(100%, 1700px); }
.results-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2.5rem; height: min(100%, 86vh); align-items: stretch;}#results-map { min-height: 300px; border: 1px solid var(--panel-border); border-radius: var(--radius); overflow: hidden;}.results-detail { display: flex; flex-direction: column; gap: 1rem; min-width: 0;}
.eyebrow { margin: 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);}#results-headline { margin: 0; font-size: 2.6rem; line-height: 1.1; font-weight: 800;}#results-sub { margin: 0; font-size: 1.15rem; color: var(--muted); }
.scores { display: flex; flex-direction: column; gap: 0.9rem; margin: 0.4rem 0 0;}.score-row { display: grid; grid-template-columns: 6.5rem 1fr; align-items: baseline; gap: 1rem;}.score-row dt { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);}.score-row dd { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 0.6rem; margin: 0;}.score-row dd span { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }.score-row dd small { color: var(--muted); }.score-row.total dd span { color: var(--gold); font-size: 2.4rem; }.bar { display: block; align-self: center; height: 0.55rem; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden;}.bar b { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);}
.caption { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; align-items: start; margin: 0.4rem 0 0;}.caption img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0.6rem; }.caption p { margin: 0 0 0.3rem; font-size: 1rem; line-height: 1.4; }.license { color: var(--muted); font-size: 0.8rem; }
.actions { display: flex; align-items: center; gap: 1rem; margin-top: auto;}.primary { padding: 0.95rem 2rem; border: none; border-radius: 0.8rem; background: var(--accent); color: #fff; font-size: 1.3rem; font-weight: 700; box-shadow: 0 6px 20px rgba(224, 98, 74, 0.35);}.primary:hover { background: var(--accent-hover); }.primary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }.kbd-hint { padding: 0.3rem 0.55rem; border: 1px solid var(--panel-border); border-radius: 0.4rem; color: var(--muted); font-size: 0.85rem;}.running { margin: 0 0 0 auto; color: var(--muted); }.running strong { color: var(--gold); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
/* ---------- final screen ---------- */.final-inner { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; max-height: 100%;}.final-total { margin: 0; font-size: 5.5rem; font-weight: 900; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums;}.final-total small { margin-left: 0.6rem; font-size: 1.4rem; font-weight: 600; color: var(--muted); }.final-rounds { display: flex; flex-direction: column; gap: 0.6rem; width: min(100%, 1100px); margin: 0; padding: 0; list-style: none; overflow: auto;}.final-round { display: grid; grid-template-columns: 6rem 1fr auto; gap: 1rem; align-items: center; padding: 0.6rem 0.9rem; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 0.9rem;}.final-round img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0.5rem; }.fr-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 0; overflow: hidden; font-size: 0.95rem; line-height: 1.35;}.fr-meta { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.85rem; }.fr-score { text-align: right; }.fr-score strong { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }.fr-score small { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }.final-foot { margin: 0; color: var(--muted); }.muted { color: var(--muted); }
/* ---------- help ---------- */.help-inner { width: min(100%, 820px); padding: 2rem 2.4rem; background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius);}.help-inner h2 { margin: 0; }.keys { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem 1.4rem; align-items: center; margin: 1.2rem 0;}.keys dt { text-align: right; white-space: nowrap; }.keys dd { margin: 0; }kbd { padding: 0.2rem 0.5rem; border: 1px solid var(--panel-border); border-bottom-width: 2px; border-radius: 0.4rem; background: rgba(255, 255, 255, 0.06); font: inherit; font-size: 0.9rem;}
/* ---------- toast ---------- */#toast { position: fixed; left: 50%; bottom: calc(var(--safe) + 1rem); z-index: 2000; transform: translateX(-50%); padding: 0.8rem 1.3rem; background: rgba(243, 242, 238, 0.95); color: #111; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); animation: fade 0.2s ease;}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; }}
/* Portrait or very narrow screens are not the target, but keep them usable. */@media (max-aspect-ratio: 1/1) { .results-grid { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } #year-panel { width: calc(100vw - 2 * var(--safe)); } #map-panel { width: calc(100vw - 2 * var(--safe)); bottom: calc(var(--safe) + 15rem); } #map-panel.expanded, #map-panel.pinned { height: 45vh; }}