@font-face {
  font-family: "NicoMojiPlusLocal";
  src: url("./assets/NicomojiPlus.ttf?v=0.1.11") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0f0f0f;
  --bg-soft: #151515;
  --panel: #1d1d1d;
  --panel-strong: #242424;
  --chip: #2a2a2a;
  --chip-hover: #353535;
  --line: #383838;
  --line-soft: #2b2b2b;
  --text: #f5f5f5;
  --muted: #a9a9a9;
  --muted-strong: #c7c7c7;
  --accent: #e5b82e;
  --accent-bright: #f4ca45;
  --accent-warm: #f08a24;
  --accent-ink: #17130a;
  --shadow: 0 18px 46px rgba(0,0,0,.32);
  font-family: system-ui, -apple-system, "Segoe UI", "Yu Gothic UI", "Yu Gothic", sans-serif;
}

body.theme-2025 {
  --accent: #e5b82e;
  --accent-bright: #f4ca45;
  --accent-warm: #f08a24;
  --accent-ink: #17130a;
}

body.theme-2026 {
  --accent: #ff7356;
  --accent-bright: #ff8b70;
  --accent-warm: #f6a23a;
  --accent-ink: #1b0d09;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -8rem, color-mix(in srgb, var(--accent) 13%, transparent), transparent 30rem),
    linear-gradient(180deg, #111 0, var(--bg) 26rem);
  color: var(--text);
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }
.shell { width: min(760px, calc(100% - 28px)); margin: 0 auto; padding: 34px 0 42px; }

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  margin: 0 4px 28px;
}
.festival-logo {
  width: auto;
  height: auto;
  max-width: 165px;
  max-height: 96px;
  object-fit: contain;
  margin: 0;
  flex: 0 1 auto;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.34));
}
h1 {
  margin: 0;
  font-family: "NicoMojiPlusLocal", "Yu Gothic", "Yu Gothic UI", system-ui, sans-serif;
  font-size: clamp(2.4rem, 6.4vw, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: .02em;
  white-space: nowrap;
}

.panel {
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 32px);
  margin-bottom: 22px;
}
.panel h2 { margin: 0 0 18px; font-size: 1.2rem; }
.filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.filter {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 12px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 750;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.filter:hover { background: #303030; border-color: #555; }
.filter.is-active {
  background: var(--accent);
  border-color: var(--accent-bright);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-bright) 54%, transparent);
}

.tag-filter-block { margin-top: 16px; padding: 14px 2px 16px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.tag-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 750;
}
.tag-filter-toggle:hover { color: var(--text); }
.selected-tags-area { margin: 0; }
#tag-suggestion-area { margin-top: 11px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #3d3d3d;
  border-radius: 999px;
  background: var(--chip);
  color: #ededed;
  cursor: pointer;
  font-size: .82rem;
  line-height: 1.25;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tag-chip:hover:not(:disabled) { background: var(--chip-hover); border-color: #5b5b5b; }
.tag-chip:disabled { cursor: not-allowed; opacity: .45; }
.tag-chip-name { overflow-wrap: anywhere; }
.tag-chip-count {
  min-width: 1.55em;
  padding: 2px 6px;
  border-radius: 999px;
  background: #171717;
  color: #bcbcbc;
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.tag-chip-selected {
  background: var(--accent);
  border-color: var(--accent-bright);
  color: var(--accent-ink);
  font-weight: 750;
}
.tag-chip-selected:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.tag-chip-close { font-size: 1rem; line-height: 1; opacity: .72; }
.tag-empty { margin: 12px 0 0; color: var(--muted); font-size: .82rem; }

.count { text-align: center; min-height: 1.5em; margin: 23px 0 12px; color: var(--muted-strong); font-weight: 650; }
.draw-button, .watch-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: var(--accent-ink);
  font-weight: 850;
  font-size: 1.08rem;
  cursor: pointer;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 23%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
}
.draw-button:hover:not(:disabled), .watch-button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.draw-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.draw-icon { font-size: 1.25rem; }
.nico-tag-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 8px 12px;
  border-radius: 10px;
  color: #e8e8e8;
  background: #252525;
  border: 1px solid #444;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 700;
}
.nico-tag-link:hover { background: #303030; border-color: #5b5b5b; text-decoration: underline; text-underline-offset: 3px; }
.subnote { margin: 13px 4px 0; color: var(--muted); font-size: .82rem; line-height: 1.65; text-align: center; }

.result { margin-bottom: 22px; }
.digging { min-height: 210px; display: grid; place-content: center; text-align: center; color: var(--accent-bright); }
.sparkle { font-size: 3rem; animation: dig 650ms ease-in-out infinite alternate; }
.digging p { margin: 7px 0 0; font-weight: 800; letter-spacing: .08em; }
@keyframes dig { from { transform: scale(.78) rotate(-12deg); opacity: .45; } to { transform: scale(1.15) rotate(12deg); opacity: 1; } }
.result-card {
  width: min(560px, 100%);
  margin-inline: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  padding-bottom: 22px;
  animation: reveal 360ms ease-out both;
}
@keyframes reveal { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.thumbnail-link { display: block; background: #161616; aspect-ratio: 16/9; overflow: hidden; }
.thumbnail { display: block; width: 100%; height: 100%; object-fit: contain; background: #111; }
.video-title { margin: 20px 22px 17px; font-size: clamp(1.15rem, 4.2vw, 1.5rem); line-height: 1.45; overflow-wrap: anywhere; }
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 22px;
}
.result-actions .watch-button { width: 100%; min-height: 48px; margin: 0; font-size: .96rem; }
.secondary-button {
  width: 100%;
  margin: 0;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}
.secondary-button:hover { background: #303030; }
.panel-small { box-shadow: none; background: #171717; }
.about p { color: var(--muted); line-height: 1.75; }
.about .coming { color: var(--text); font-weight: 800; font-size: 1.04rem; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--accent-bright); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.updated { font-size: .76rem; margin-bottom: 0; }
.service-note { margin: 16px 0 0; font-size: .72rem; color: #888 !important; line-height: 1.65 !important; }
.site-footer { text-align: center; color: #696969; font-size: .72rem; padding: 3px 0 0; }
.site-footer a[href] { color: #8d8d8d; text-decoration: none; }
.site-footer a[href]:hover { color: #b8b8b8; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 560px) {
  .hero { flex-direction: column; gap: 7px; margin-bottom: 22px; }
  .festival-logo { max-width: min(210px, 65vw); max-height: 122px; }
  h1 { font-size: clamp(2.15rem, 11vw, 2.9rem); white-space: normal; }
}

@media (max-width: 480px) {
  .shell { width: min(100% - 20px, 760px); padding-top: 22px; }
  .filters { gap: 7px; }
  .filter { min-height: 45px; }
  .panel { border-radius: 18px; }
  .tag-list { gap: 6px; }
  .tag-chip { font-size: .78rem; padding: 6px 9px; }
  .result-actions { gap: 7px; margin-inline: 14px; }
  .result-actions .watch-button, .result-actions .secondary-button { font-size: .86rem; padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* hidden must win over component display rules */
[hidden] { display: none !important; }
