:root {
	--ink: #1E2230;
	--soft: #5E6372;
	--line: #ECE7DD;
	--paper: #FFFDF8;
	--accent: #C2410C;
	--accent-dark: #9A3412;
	--accent-tint: #FFEDD5;
	--green: #15803D;
	--red: #B91C1C;
	--night: #1F2433;
	color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.5 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
h1, h2 { text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { text-wrap: pretty; margin: 0; }
button { font: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
#home { padding-top: 40px; padding-bottom: 64px; }
.intro { max-width: 40rem; margin-bottom: 28px; }
.intro h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.1; font-weight: 800; }
.intro p { margin-top: 10px; color: var(--soft); font-size: 18px; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--paper); box-shadow: 0 1px 2px rgba(30, 34, 48, 0.04); transition-property: transform, box-shadow; transition-duration: 150ms; transition-timing-function: ease-out; }
.card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--night); }
.card-text { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.card-text strong { font-size: 19px; font-weight: 800; line-height: 1.25; }
.card-text > span { color: var(--soft); font-size: 15px; text-wrap: pretty; }
.card-text .tag { align-self: flex-start; margin-top: auto; padding-top: 8px; color: var(--accent); font-size: 13px; font-weight: 700; }
@media (hover: hover) { .card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(30, 34, 48, 0.35); } }
.card:active { transform: scale(0.98); }

.box { margin-top: 40px; max-width: 44rem; }
.box h2 { font-size: 22px; font-weight: 800; }
.hint { margin-top: 6px; color: var(--soft); }
.comment { margin-top: 12px; }
.comment textarea { display: block; width: 100%; min-height: 120px; resize: vertical; padding: 12px 14px; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid #DDD6CA; border-radius: 12px; }
.comment textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.row { display: flex; align-items: center; gap: 14px; margin-top: 10px; min-height: 48px; }
.comment button { min-height: 48px; padding: 0 26px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 800; cursor: pointer; transition-property: background-color, transform; transition-duration: 150ms; }
.comment button:hover { background: var(--accent-dark); }
.comment button:active { transform: scale(0.97); }
.comment button:disabled { opacity: 0.6; cursor: default; }
.status { color: var(--soft); font-weight: 600; }
.status[data-state="ok"] { color: var(--green); }
.status[data-state="error"] { color: var(--red); }

.play { padding-bottom: 64px; }
.bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
.bar h1 { font-size: 18px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font-weight: 700; cursor: pointer; white-space: nowrap; transition-property: background-color, transform; transition-duration: 150ms; }
.back svg { width: 20px; height: 20px; }
.back:hover { background: #F5F0E6; }
.back:active { transform: scale(0.97); }
.stage { position: relative; height: calc(100dvh - 60px); background: var(--night); }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.load-error { padding: 48px 16px; color: #fff; text-align: center; }
@media (min-width: 1024px) { .stage { height: min(760px, calc(100dvh - 60px)); } }

@media (prefers-reduced-motion: reduce) { .card, .back, .comment button { transition: none; } .card:hover, .card:active { transform: none; } }
.card img.top { object-position: top; }
