/* Copyright (C) Konstantin Khait, Squirrel Wisdom Academy, 2026 */
/* The constructor's look (tools/editor/editor.css, same tokens): dark is the default, the colours of the splash (navy, gold, cream); light is the editor's own.
   theme.js sets data-theme on <html> before the first paint (the choice is kept in this browser); without it the page is dark. */
:root { --brand: #5066C9; --brand-light: #88AADD; --bg: #f3f4fb; --panel: #ffffff; --line: #e2e4f0; --line2: #d3d6ea; --text: #222; --dim: #6b7290; --soft: #eef0fb; --danger: #d92c2c;
  --bar: #5066C9; --bar-line: #88AADD; --accent: #5066C9; --accent-fg: #fff; --link: #5066C9; --ok: #2e8b4a; --sel: #dde0f7; --field: #fff; --pop: #fff; --pop-line: #ccd; --pop-hover: #eef;
  --btn: #e2e4f0; --btn-fg: #333; --shadow: #1a1f4a33; --veil: rgba(20, 24, 50, .5); --mark: #fff; --bar-fg: #fff; --title: #1b1f3a;
  --navy: #081b33; --gold: #d4a336; --gold2: #e8c066; --cream: #f3e7c9; }
:root:not([data-theme=light]) { color-scheme: dark; --brand: #d4a336; --brand-light: #e8c066; --bg: #081b33; --panel: #0b2240; --line: #17314f; --line2: #26496e; --text: #e8edf7; --dim: #8fa3c4; --soft: #12304f; --danger: #ff7a7a;
  --bar: #0c2640; --bar-line: #d4a336; --accent: #d4a336; --accent-fg: #1c1405; --link: #e8c066; --ok: #5fd08a; --sel: #1a416b; --field: #06182d; --pop: #0d2745; --pop-line: #26496e; --pop-hover: #16385c;
  --btn: #17314f; --btn-fg: #e8edf7; --shadow: #00000066; --veil: rgba(2, 10, 22, .65); --mark: #d4a336; --bar-fg: #f3e7c9; --title: #f3e7c9; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 "Segoe UI", Helvetica, Arial, sans-serif; }
body { min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: .4em 0 .5em; color: var(--title); } h2 { font-size: 16px; margin: 1.4em 0 .5em; color: var(--title); }
button, input, textarea, select { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--line2); border-radius: 6px; padding: 5px 10px; }
button { cursor: pointer; background: var(--btn); color: var(--btn-fg); }
button:hover:not(:disabled) { border-color: var(--accent); } button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 700; letter-spacing: .02em; padding: 9px 18px; border-radius: 10px; }
:root:not([data-theme=light]) button.primary { background: linear-gradient(180deg, var(--gold2), var(--gold)); border: none; box-shadow: 0 6px 18px #d4a33644; transition: transform .12s, box-shadow .12s, filter .12s; }
:root:not([data-theme=light]) button.primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 9px 24px #d4a33666; }
button.link { background: none; border: 0; color: var(--link); padding: 2px 0; text-decoration: underline; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { width: 100%; resize: vertical; }

/* the bar: the editor's menu bar (bar colour, a 3px line under it); the name in the splash's letter-spaced gold */
.bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--bar); color: var(--bar-fg); border-bottom: 3px solid var(--bar-line); padding: 6px 16px; position: sticky; top: 0; z-index: 10; }
.bar a { color: var(--bar-fg); }
.brand { display: flex; align-items: center; gap: 10px; font: 800 17px/1 "Segoe UI", Helvetica, Arial, sans-serif; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); text-decoration: none !important; }
.brand img { border-radius: 8px; box-shadow: 0 0 0 1px #d4a33666; }
:root[data-theme=light] .brand { color: #fff; }
#search { display: flex; gap: 6px; flex: 1 1 260px; max-width: 520px; } #search input { flex: 1; min-width: 0; }
#nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
#nav a, #nav button { color: var(--bar-fg); background: none; border: 0; border-radius: 6px; padding: 5px 10px; text-decoration: none; } #nav a:hover, #nav button:hover:not(:disabled) { background: #ffffff30; text-decoration: none; }
#nav .who { opacity: .8; font-size: 13px; overflow: hidden; text-overflow: ellipsis; max-width: 14em; white-space: nowrap; padding: 0 6px; }

/* the way into the constructor, large, next to the menu */
#nav a.create { font: 800 15px/1 "Segoe UI", Helvetica, Arial, sans-serif; letter-spacing: .14em; padding: 12px 22px; margin-right: 10px; border-radius: 10px; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1c1405; box-shadow: 0 4px 14px #d4a33644; transition: transform .12s, box-shadow .12s, filter .12s; }
#nav a.create:hover { background: linear-gradient(180deg, var(--gold2), var(--gold)); transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 8px 22px #d4a33666; }
:root[data-theme=light] #nav a.create { background: #fff; color: var(--brand); box-shadow: 0 4px 14px #1a1f4a44; }
:root[data-theme=light] #nav a.create:hover { background: #fff; }
main { flex: 1; } .page { max-width: 1280px; margin: 0 auto; padding: 16px; }
/* the status bar of the editor */
.foot { text-align: center; color: var(--dim); font-size: 12px; background: var(--bg); border-top: 1px solid var(--line); padding: 8px 14px; }
.foot-co { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 4px; } .foot-co a { color: var(--link); }
.dim { color: var(--dim); } .empty { color: var(--dim); padding: 30px 0; text-align: center; }
.note { background: var(--soft); border: 1px solid var(--line2); border-radius: 8px; padding: 10px 14px; margin: 10px 0; } .note.error, .status.error { color: var(--danger); }
.status { min-height: 1.4em; margin: .4em 0; } .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: .6em 0; }

/* the feed's heading: the splash's ferret (drawn with the image API) and the title beside it */
#splash { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(2,8,18,.72); opacity: 1; transition: opacity .6s ease; }
#splash.gone { opacity: 0; pointer-events: none; }
#splash .hero-art { width: clamp(200px, 34vw, 420px); -webkit-mask-image: none; mask-image: none; filter: drop-shadow(0 6px 22px #000b); }
#splash .hero h1 { font-size: clamp(54px, 10vw, 120px); color: var(--gold); text-shadow: 0 3px 0 #8a6a1c, 0 0 28px #000, 0 6px 34px #000d; }
#splash .hero p { font-size: clamp(17px, 3vw, 32px); color: var(--cream); border-top-color: var(--gold); text-shadow: 0 2px 14px #000, 0 0 30px #000c; }
.hero { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 40px); padding: clamp(6px, 2vh, 20px) 0 clamp(10px, 2vh, 20px); }
.hero-art { width: clamp(170px, 30vw, 340px); height: auto; flex: none; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); }
.hero-text { text-align: left; }
.hero h1 { margin: 0; font: 700 clamp(44px, 8vw, 96px)/.95 'Trebuchet MS', 'Arial Rounded MT Bold', 'Segoe UI', Helvetica, Arial, sans-serif; letter-spacing: .06em; color: var(--gold); text-shadow: 0 3px 0 #8a6a1c, 0 6px 26px #d4a33655; }
.hero p { margin: .45em 0 0; padding-top: .45em; border-top: 2px solid var(--gold); font: italic 400 clamp(15px, 2.4vw, 26px)/1.25 'Trebuchet MS', 'Segoe UI', Helvetica, Arial, sans-serif; letter-spacing: .03em; color: var(--cream); }
:root[data-theme=light] .hero h1 { color: var(--brand); text-shadow: none; }
:root[data-theme=light] .hero p { color: var(--dim); border-top-color: var(--brand); }
@media (max-width: 560px) { .hero { flex-direction: column; text-align: center; } .hero-text { text-align: center; } .hero p { border-top: 0; padding-top: 0; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
/* the feed's one line: what is shown on the left, in which order on the right edge (on a narrow screen the order drops under, still at the right) */
.feed-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; column-gap: 24px; } .feed-bar .sorts { margin-left: auto; justify-content: flex-end; }
.chip { padding: 5px 14px; border-radius: 99px; background: var(--btn); color: var(--btn-fg); border: 1px solid transparent; text-decoration: none; } .chip:hover { border-color: var(--accent); text-decoration: none; }
.chip.on { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin: 6px 0; }
.tile { display: block; color: inherit; text-decoration: none; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; transition: border-color .12s, transform .12s, box-shadow .12s; }
.tile:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px var(--shadow); } .tile:hover .title { color: var(--link); }
.shot { position: relative; aspect-ratio: 16 / 9; background: #0d0f16; overflow: hidden; }
.shot img, .shot video, .noposter { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot video { opacity: 0; transition: opacity .2s; } .tile.playing .shot video { opacity: 1; }
.badge { position: absolute; bottom: 8px; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; background: rgba(8, 27, 51, .82); color: var(--cream); }
.badge.kind { left: 8px; } .badge.price { right: 8px; color: var(--gold2); } .badge.price.free { background: var(--ok); color: #06210f; }
.meta { padding: 10px 12px 12px; } .title { font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--title); } .sub { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px 0; color: var(--dim); } .loading[hidden] { display: none; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.more { display: block; margin: 20px auto; padding: 8px 28px; }

.stage { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 78vh; background: #0d0f16; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; margin: 0 auto; box-shadow: 0 8px 28px var(--shadow); }
.stage ferret-player, .stage video, .stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; margin-top: 14px; } .side { padding-top: 6px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.headline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .headline h1 { margin: 0; }
.headline .badge { position: static; background: var(--accent); color: var(--accent-fg); }
.actions { margin: 12px 0; } .actions button.primary { min-width: 220px; }
.file { margin: 6px 0; } .primary-link { font-weight: 600; } .key { font-size: 12px; color: var(--dim); word-break: break-all; } .key code { user-select: all; }
.text { white-space: pre-wrap; } .tags { display: flex; gap: 6px; flex-wrap: wrap; } .tag { background: var(--soft); border: 1px solid var(--line2); border-radius: 99px; padding: 2px 10px; font-size: 12px; text-decoration: none; color: var(--text); } .tag:hover { border-color: var(--accent); text-decoration: none; }
.block { margin: 14px 0; } .block.mod { border-top: 1px solid var(--line2); padding-top: 8px; }
.mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mini-tile { display: block; text-decoration: none; color: inherit; font-size: 12.5px; } .mini-tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #0d0f16; display: block; }
.comment { border-top: 1px solid var(--line); padding: 8px 0; white-space: pre-wrap; }

.table { width: 100%; border-collapse: collapse; } .table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); } .table th { color: var(--dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.complaint { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }

/* the sign-in: the constructor's (the world picture, the card with a gold edge, the gold button) */
.signin-page { position: fixed; inset: 0; z-index: 30; overflow: auto; display: flex; align-items: center; justify-content: flex-end; padding: 32px clamp(20px, 6vw, 110px); color: var(--cream);
  background: var(--navy) url(brand/ferret-world.webp) left center / auto 100% no-repeat; }
.signin-page::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 52%, #081b33cc 100%); }
.signin { position: relative; width: min(100%, 410px); display: flex; flex-direction: column; gap: 12px; padding: 28px 30px 24px; border-radius: 18px; border: 1px solid #d4a33644; background: #0a2038d9; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 18px 60px #00000080, inset 0 1px 0 #ffffff10; }
.signin .signin-brand { display: flex; align-items: center; gap: 14px; } .signin .signin-brand img { border-radius: 14px; box-shadow: 0 0 0 1px #d4a33666, 0 6px 20px #00000066; }
.signin h1 { margin: 0; font: 800 22px/1.1 "Segoe UI", Helvetica, Arial, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.signin .signin-brand span { display: block; margin-top: 4px; font-size: 13px; color: #9fb0d2; letter-spacing: .03em; }
.signin h2 { margin: 6px 0 0; font: 600 20px/1.2 "Segoe UI", Helvetica, Arial, sans-serif; color: #fff; }
.signin .signin-lead { margin: 0; font-size: 13.5px; line-height: 1.45; color: #aebbd6; }
.signin label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #c3cde3; }
.signin input { font-size: 15px; padding: 10px 12px; color: #fff; background: #04101f99; border: 1px solid #ffffff26; border-radius: 10px; color-scheme: dark; }
.signin input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #d4a33633; }
.signin input:-webkit-autofill { -webkit-text-fill-color: #fff; box-shadow: 0 0 0 40px #0a2038 inset; }
.signin button.primary { padding: 11px; border-radius: 10px; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #1c1405; border: none; }
.signin .status.error { color: #ff8a8a; margin: 0; font-size: 13.5px; }
@media (max-width: 900px) { .signin-page { align-items: flex-end; justify-content: center; background-size: 100% auto; background-position: center top; } .signin-page::before { background: linear-gradient(180deg, transparent 26%, #081b33 46%); } }

/* dialogs: the editor's modal */
.veil { position: fixed; inset: 0; background: var(--veil); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog { background: var(--bg); border: 1px solid var(--line2); border-radius: 12px; padding: 20px; max-width: 100%; box-shadow: 0 8px 28px #00000060; text-align: center; }
.dialog h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.captcha-img { display: block; margin: 8px auto; max-width: 100%; height: auto; cursor: crosshair; border: 1px solid var(--line2); border-radius: 8px; }
@media (max-width: 560px) { .page { padding: 12px; } .grid { grid-template-columns: 1fr; } #nav { margin-left: 0; width: 100%; } }

/* the card's bar: the thumbs (vote.js) and the way into the discussion; the same thumbs sit under a publication's title */
.tile-link { display: block; color: inherit; text-decoration: none; } .tile-link:hover { text-decoration: none; }
.tile-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 8px; border-top: 1px solid var(--line); }
.vote-widget { display: inline-flex; gap: 4px; }
.vote-btn { display: inline-flex; align-items: center; justify-content: center; padding: 3px 6px; background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.vote-btn:hover { border-color: var(--line2); background: var(--field); } .vote-btn:disabled { opacity: .5; cursor: default; } .vote-btn img { display: block; }
.vote-btn.on { border-color: var(--accent); }
.tile-comments { font-size: 13px; color: var(--link); padding: 4px 6px; border-radius: 8px; } .tile-comments:hover { background: var(--field); text-decoration: none; }
.head .vote-widget { margin-top: 6px; }
:root[data-theme=light] .vote-btn:not(.on) img { filter: brightness(.5) saturate(.7); }
