/* =========================================================
   Windows Rice Contest: the site is a desktop.
   Two themes, one per host. Shared layout, different rice.
   ========================================================= */

:root {
  --ut: #4f8dff;   /* Unknown Tech: banner blue */
  --sc: #b5df57;   /* SleepyCatHey: meadow green */
  --sky: #8fd0ff;  /* SleepyCatHey: avatar sky */
  --pink: #ffb7c9; /* SleepyCatHey: cat ears */
  --ok: #7ddc9a;
  --err: #ff8080;
  --warn: #ffc864;
  --mono: "Cascadia Code", "Cascadia Mono", "JetBrains Mono", Consolas, ui-monospace, monospace;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --gap: 14px;
}

/* ---- one look for both hosts: Unknown Tech's glassy blue + SleepyCatHey's mono, tiled, green ---- */
:root {
  --bg: #080c13;
  --text: #eaf0f6;
  --muted: #93a2b0;
  --accent: #8fd0ff;
  --accent2: #b5df57;
  --win-bg: rgba(16, 24, 34, 0.6);
  --win-bar-bg: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.12);
  --line-w: 1px;
  --radius: 12px;
  --radius-s: 8px;
  --blur: blur(26px) saturate(150%);
  --font: var(--sans);
  --btn-bg: linear-gradient(115deg, #4f8dff 0%, #8fd0ff 50%, #b5df57 100%);
  --btn-text: #06101a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --focus-glow: -8px 0 34px rgba(79, 141, 255, 0.22), 8px 0 34px rgba(181, 223, 87, 0.16);
}
.wall {
  background:
    radial-gradient(58vmax 58vmax at 4% -14%, rgba(120, 172, 236, 0.6), rgba(46, 96, 178, 0.26) 46%, transparent 62%),
    radial-gradient(40vmax 40vmax at 30% 112%, rgba(30, 62, 128, 0.5), transparent 62%),
    radial-gradient(60vmax 56vmax at 104% 106%, rgba(74, 128, 58, 0.6), transparent 62%),
    radial-gradient(34vmax 30vmax at 96% -6%, rgba(226, 232, 120, 0.22), transparent 62%),
    linear-gradient(115deg, #0a152c 0%, #080c13 50%, #0c150b 100%);
}
.wall::before {
  content: ""; position: absolute; left: -14vmax; top: 22vh; width: 52vmax; height: 52vmax;
  background: url("art/spiral.svg") center / contain no-repeat; opacity: 0.1; animation: spin 240s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.win-btns i:nth-child(1) { background: var(--ut); }
.win-btns i:nth-child(2) { background: var(--sky); }
.win-btns i:nth-child(3) { background: var(--sc); }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.55 var(--font); color: var(--text); background: var(--bg);
}
.wall { position: fixed; inset: 0; z-index: -1; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(24px, 3vw, 34px); }
p { margin: 0 0 14px; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grad { background: linear-gradient(115deg, var(--ut), var(--sky) 50%, var(--sc)); -webkit-background-clip: text; background-clip: text; color: transparent; }
main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 8px var(--gap) 50px; }

/* ---------- status bar ---------- */
.bar {
  position: sticky; top: var(--gap); z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: var(--gap) var(--gap) 10px; padding: 6px 8px;
  font-family: var(--mono); font-size: 13px;
  background: var(--win-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: var(--line-w) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.bar-l, .bar-r { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bar form { margin: 0; display: flex; }
.bar-logo { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 6px; font-weight: 700; font-family: var(--font); font-size: 14px; }
.mark { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(115deg, var(--ut) 0 50%, var(--sc) 50% 100%); box-shadow: -3px 0 12px rgba(79, 141, 255, 0.45), 3px 0 12px rgba(181, 223, 87, 0.35); }
.ws { display: flex; gap: 3px; flex-wrap: wrap; }
.ws a { display: flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: var(--radius-s); color: var(--muted); }
.ws a b { font-weight: 600; opacity: 0.6; }
.ws a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.ws a.on { color: var(--btn-text); background: var(--accent); }
.ws a.on b { opacity: 0.75; }
.mod {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: var(--radius-s);
  background: rgba(255, 255, 255, 0.05); color: var(--text); border: 0; font: inherit; white-space: nowrap;
}
.mod-btn, .theme-switch { cursor: pointer; }
.mod-btn:hover, .theme-switch:hover { background: rgba(255, 255, 255, 0.12); }
.mod-login { background: var(--accent); color: var(--btn-text); font-weight: 700; }
.mod-login:hover { background: var(--accent); filter: brightness(1.1); }
.mod-user { color: var(--accent); }
.mod-time { color: var(--warn); }
.ico { width: 9px; height: 9px; display: inline-block; }
.ico-entries { border: 2px solid var(--accent); border-radius: 2px; }
.ico-votes { background: var(--accent2); border-radius: 50%; }
.sw { width: 11px; height: 11px; border-radius: 50%; opacity: 0.35; transition: opacity 0.15s, transform 0.15s; }
.sw-ut { background: var(--ut); }
.sw-sc { background: var(--sc); }
.sw-ut { color: var(--ut); }
.sw-sc { color: var(--sc); }

/* ---------- windows ---------- */
.win {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--win-bg); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: var(--line-w) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.win:hover, .win:focus-within { border-color: var(--accent); box-shadow: var(--focus-glow), var(--shadow); }
.win-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 12px; background: var(--win-bar-bg); border-bottom: var(--line-w) solid var(--line);
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
.win-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win:hover .win-title, .win:focus-within .win-title { color: var(--text); }
.win-btns { display: flex; gap: 7px; flex-shrink: 0; }
.win-btns i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.win-body { padding: 22px; flex: 1; min-width: 0; }

.tiles { display: grid; gap: var(--gap); }
.tiles-home { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.tiles-entry { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.narrow { max-width: 680px; margin: 30px auto; }
.dialog { max-width: 520px; margin: 9vh auto; text-align: center; }
.dialog .win-body { padding: 34px 28px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.row form { margin: 0; }

/* ---------- buttons, inputs, small bits ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: var(--radius-s); border: var(--line-w) solid transparent;
  background: var(--btn-bg); color: var(--btn-text); font: inherit; font-weight: 700; cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn.ghost { background: rgba(255, 255, 255, 0.05); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.danger { background: rgba(255, 128, 128, 0.1); color: var(--err); border-color: rgba(255, 128, 128, 0.35); }
.btn.small { padding: 6px 12px; font-size: 0.875em; }
.btn.big { padding: 13px 24px; font-size: 1.05em; }

input[type="search"], input[type="text"], input:not([type]), textarea, input[type="file"] {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-s); border: var(--line-w) solid var(--line);
  background: rgba(0, 0, 0, 0.32); color: var(--text); font: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.flash { padding: 11px 16px; border-radius: var(--radius-s); margin-bottom: var(--gap); font-family: var(--mono); font-size: 14px; border: var(--line-w) solid rgba(125, 220, 154, 0.4); background: rgba(125, 220, 154, 0.1); }
.flash::before { content: "[ok] "; color: var(--ok); }
.flash.err { border-color: rgba(255, 128, 128, 0.4); background: rgba(255, 128, 128, 0.1); }
.flash.err::before { content: "[error] "; color: var(--err); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font: 600 11.5px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; background: rgba(255, 255, 255, 0.08); color: var(--muted); margin-bottom: 10px; }
.badge.approved { background: rgba(125, 220, 154, 0.14); color: var(--ok); }
.badge.rejected { background: rgba(255, 128, 128, 0.14); color: var(--err); }
.badge.pending { background: rgba(255, 200, 100, 0.14); color: var(--warn); }
.pick { display: inline-block; padding: 3px 10px; margin: 0 6px 8px 0; border-radius: 99px; font: 700 12px var(--mono); background: linear-gradient(115deg, var(--ut), var(--sc)); color: #08101c; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.chip { padding: 2px 9px; border-radius: var(--radius-s); font: 12.5px var(--mono); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5a6072; margin-right: 8px; }
.dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

.mascot { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 auto 18px; }
.mascot span { align-self: center; margin-left: -70px; }
.tiles-home { position: relative; margin-top: 46px; }
.peek { position: absolute; right: 52px; top: -49px; width: 100px; z-index: 1; pointer-events: none; }
.mascot img { width: 170px; height: auto; }
.mascot span { font: 13px var(--mono); color: var(--muted); letter-spacing: 0.3em; animation: zzz 2.6s ease-in-out infinite; }
@keyframes zzz { 0%, 100% { opacity: 0.25; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-2px); } }

/* ---------- home ---------- */
.tile-welcome .win-body { padding: 30px 28px; display: flex; flex-direction: column; justify-content: center; }
.tile-welcome h1 { font-size: clamp(32px, 4.4vw, 56px); margin-bottom: 14px; }
.lead { font-size: 1.1em; color: var(--muted); max-width: 52ch; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

.hosts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.host { display: flex; align-items: center; gap: 10px; padding: 6px 15px 6px 6px; border-radius: 99px; border: var(--line-w) solid var(--line); background: rgba(255, 255, 255, 0.04); transition: transform 0.12s ease; }
.host:hover { transform: translateY(-2px); }
.host img, .host-mono { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-weight: 800; color: #08101c; background: #fff; }
.host > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.host small { color: var(--muted); font: 11px var(--mono); }
.host-ut { border-color: rgba(79, 141, 255, 0.55); }
.host-sc { border-color: rgba(181, 223, 87, 0.5); }
.host-ut .host-mono { background: var(--ut); }
.host-sc .host-mono { background: var(--sc); }
.host-x { color: var(--muted); font-size: 20px; }

/* terminal + fastfetch */
.term .win-body { font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }
.term p { margin: 0; }
.prompt { color: var(--muted); margin-bottom: 12px !important; }
.fetch + .prompt { margin: 14px 0 0 !important; }
.p-user { color: var(--accent); font-weight: 700; }
.p-host { color: var(--accent2); font-weight: 700; }
.p-path { color: var(--sky); }
.cursor { display: inline-block; width: 9px; height: 1.05em; vertical-align: text-bottom; background: var(--text); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.fetch { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }
.fetch-logo { margin: 0; font: 11px/1.15 var(--mono); letter-spacing: -1px; }
.a1 { color: var(--ut); } .a2 { color: var(--sky); } .a3 { color: var(--sky); } .a4 { color: var(--sc); }
.fetch-info { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.fetch-info p { margin: 0; }
.fetch-info b { color: var(--accent); font-weight: 700; }
.fetch-head { font-weight: 700; }
.fetch-rule { color: var(--muted); }
.fetch-info.small { font: 12.5px/1.55 var(--mono); margin: 8px 0; }
.swatches { display: flex; margin-top: 12px !important; }
.swatches i { width: 26px; height: 16px; }
.swatches i:nth-child(1) { background: #12305f; } .swatches i:nth-child(2) { background: var(--ut); }
.swatches i:nth-child(3) { background: var(--sky); } .swatches i:nth-child(4) { background: var(--pink); }
.swatches i:nth-child(5) { background: var(--sc); } .swatches i:nth-child(6) { background: #4c7a3c; }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; }
.steps li::before { content: counter(s); grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-s); font: 700 14px var(--mono); background: rgba(255, 255, 255, 0.07); color: var(--accent); }
.steps li:nth-child(2)::before { color: var(--sky); }
.steps li:nth-child(3)::before { color: var(--accent2); }
.steps span { color: var(--muted); }

.shot-wall { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.shot-wall img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); }
.video-ph { width: 100%; aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-s); border: var(--line-w) dashed var(--line); background: rgba(0, 0, 0, 0.3); color: var(--text); font: inherit; cursor: pointer; }
.video-ph:hover { border-color: var(--accent); }
.video-ph small { color: var(--muted); }
.play { width: 0; height: 0; border-style: solid; border-width: 16px 0 16px 28px; border-color: transparent transparent transparent var(--accent); }
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-s); }

/* ---------- page head ---------- */
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin: 14px 4px 18px; }
.page-head h1 { font-family: var(--mono); }
.page-head p { margin: 0; }
.search { display: flex; gap: 8px; }
.search input { min-width: 250px; }

/* ---------- gallery ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.tile:hover { transform: translateY(-3px); }
.tile-img { position: relative; display: block; aspect-ratio: 16 / 9; background: #000; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-img .pick { position: absolute; left: 8px; bottom: 0; }
.tile-by { padding: 7px 12px; font: 12.5px var(--mono); color: var(--muted); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; font-family: var(--mono); }
.pager a { padding: 6px 13px; border-radius: var(--radius-s); background: var(--win-bg); border: var(--line-w) solid var(--line); }
.pager a.on { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }

/* ---------- entry ---------- */
.viewer-win .win-body { padding: 10px; }
.viewer-main { width: 100%; border-radius: var(--radius-s); background: #000; }
.zoomable { cursor: zoom-in; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { padding: 0; border: 2px solid transparent; border-radius: var(--radius-s); overflow: hidden; background: none; cursor: pointer; width: 120px; aspect-ratio: 16 / 9; opacity: 0.55; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.on, .thumb:hover { opacity: 1; border-color: var(--accent); }
.entry-info h1 { font-family: var(--font); font-size: 26px; margin-bottom: 12px; }
.entry-info .prompt { margin-top: 6px; }
.desc { margin: 16px 0; overflow-wrap: anywhere; font-family: var(--font); font-size: 15px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; margin-top: 18px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.93em; }
.form .check { display: flex; gap: 10px; align-items: start; font-weight: 400; }
.form .check input { margin-top: 5px; }
.specs { border: var(--line-w) solid var(--line); border-radius: var(--radius-s); padding: 14px; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.specs legend { padding: 0 8px; font: 600 13px var(--mono); color: var(--accent); }
.previews, .mini-shots { display: flex; gap: 8px; flex-wrap: wrap; }
.previews img, .mini-shots img { width: 150px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); }
.mini-shots { margin: 14px 0; }

/* ---------- vote arena ---------- */
.duel-wrap { position: relative; }
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); transition: opacity 0.18s ease; }
.duel.loading { opacity: 0.35; pointer-events: none; }
.side .win-body { padding: 0; display: flex; flex-direction: column; }
.side:first-child { border-top: 3px solid var(--ut); }
.side:last-child { border-top: 3px solid var(--sc); }
.side:first-child:hover { border-color: var(--ut); box-shadow: 0 0 0 1px var(--ut), 0 0 40px rgba(79, 141, 255, 0.22); }
.side:last-child:hover { border-color: var(--sc); box-shadow: 0 0 0 1px var(--sc), 0 0 40px rgba(181, 223, 87, 0.18); }
.side.picked { transform: scale(1.012); border-color: var(--ok); }
.side-img { position: relative; background: #000; aspect-ratio: 16 / 9; }
.side-img img { width: 100%; height: 100%; object-fit: contain; }
.side-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; gap: 6px; justify-content: center; }
.side-dots button { width: 34px; height: 6px; padding: 0; border: 0; border-radius: 3px; background: rgba(255, 255, 255, 0.35); cursor: pointer; }
.side-dots button.on { background: #fff; }
.side-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.side-body .btn { margin-top: auto; }
.side:first-child .btn { background: var(--ut); color: #06101f; }
.side:last-child .btn { background: var(--sc); color: #10180b; }
.vs { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); z-index: 2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--bg); border: var(--line-w) solid var(--line); font: 700 15px var(--mono); box-shadow: -6px 0 22px rgba(79, 141, 255, 0.4), 6px 0 22px rgba(181, 223, 87, 0.3); pointer-events: none; }
.duel:empty + .vs { display: none; }

/* ---------- ranking ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.place-1 { border-color: rgba(255, 210, 100, 0.7); }
.place-2 { border-color: rgba(200, 210, 225, 0.5); }
.place-3 { border-color: rgba(215, 150, 100, 0.5); }
.table-wrap .win-body { padding: 4px 10px; overflow-x: auto; }
.board { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 14px; }
.board th, .board td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.board th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.board tr:last-child td { border-bottom: 0; }
.board td a:hover { color: var(--accent); }
.board .pick { margin: 0 0 0 6px; }

/* ---------- admin ---------- */
.toggles-win { margin-bottom: var(--gap); }
.toggles { display: flex; gap: 12px; flex-wrap: wrap; }
.toggles form { display: flex; align-items: center; gap: 12px; margin: 0; padding: 8px 12px; border: var(--line-w) solid var(--line); border-radius: var(--radius-s); }
.admin-entry { margin-bottom: var(--gap); }
.admin-entry .win-body { display: grid; grid-template-columns: 330px 1fr; gap: 20px; }
.admin-entry .mini-shots { margin: 0; align-content: start; }

/* ---------- lightbox, footer ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0, 0, 0, 0.93); cursor: zoom-out; padding: 2vmin; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 96vh; border-radius: 6px; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 22px 20px; color: var(--muted); font: 12.5px var(--mono); }
.foot-links { display: flex; gap: 16px; }
.foot a:hover { color: var(--text); }
.foot-host-ut:hover { color: var(--ut) !important; }
.foot-host-sc:hover { color: var(--sc) !important; }

@media (max-width: 960px) {
  .tiles-home, .tiles-entry, .duel, .podium, .admin-entry .win-body, .specs { grid-template-columns: 1fr; }
  .vs, .bar-name, .mod-clock, .peek { display: none; }
  .tiles-home { margin-top: 0; }
  .bar { position: static; }
  .search input { min-width: 0; }
  .fetch-logo { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor, .mascot span, .wall::before { animation: none; }
  .win, .btn, .host { transition: none; }
}
