:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #182033;
  --muted: #596579;
  --line: #d9e0ea;
  --brand: #3157d5;
  --brand-strong: #2443aa;
  --brand-soft: #e7ecff;
  --success: #177245;
  --warning: #9a6700;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(30, 41, 59, .09);
  --radius: 18px;
  --max-width: 1440px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1320;
  --surface: #151c2d;
  --surface-2: #1d2639;
  --text: #f0f3f9;
  --muted: #a8b1c2;
  --line: #2a3549;
  --brand: #8da2ff;
  --brand-strong: #b4c0ff;
  --brand-soft: #273258;
  --success: #75d4a0;
  --warning: #f5c55f;
  --danger: #ff9b94;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); line-height: 1.55; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-150%); padding: .7rem 1rem; background: var(--text); color: var(--surface); border-radius: 10px; }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px); }
.header-inner { max-width: var(--max-width); margin: auto; padding: .85rem clamp(1rem, 3vw, 2rem); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(145deg, var(--brand), var(--brand-strong)); color: white; font-weight: 850; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 28%, transparent); }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .78rem; }
.header-actions { display: flex; gap: .6rem; align-items: center; }
.language-control select, .icon-button { min-height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
.language-control select { padding: 0 2rem 0 .8rem; max-width: 210px; }
.icon-button { width: 42px; font-size: 1.15rem; }

.hero { overflow: hidden; background: radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 30%), linear-gradient(180deg, var(--surface), var(--bg)); border-bottom: 1px solid var(--line); }
.hero-inner { max-width: var(--max-width); margin: auto; padding: clamp(3rem, 8vw, 6.5rem) clamp(1rem, 3vw, 2rem) clamp(2.5rem, 6vw, 4rem); }
.eyebrow { margin: 0 0 .45rem; color: var(--brand); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { max-width: 860px; margin: 0; font-size: clamp(2.35rem, 6vw, 5.2rem); line-height: .98; letter-spacing: -.055em; }
.hero-copy { max-width: 760px; margin: 1.35rem 0 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.2rem); }
.summary { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }
.summary-pill { padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 86%, transparent); color: var(--muted); font-size: .88rem; }
.summary-pill strong { color: var(--text); }

.workspace { max-width: var(--max-width); margin: auto; padding: 2rem clamp(1rem, 3vw, 2rem) 5rem; display: grid; grid-template-columns: minmax(240px, 310px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.filters, .results { min-width: 0; }
.filters { position: sticky; top: 87px; padding: 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.filter-heading, .results-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.025em; }
.text-button { border: 0; background: transparent; color: var(--brand); font-weight: 750; padding: .35rem; }
.field { display: grid; gap: .35rem; margin-top: 1rem; color: var(--muted); font-size: .88rem; font-weight: 700; }
.field input, .field select, .sort-control select { width: 100%; min-height: 45px; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); outline: none; }
.field input:focus, .field select:focus, .sort-control select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.privacy-note { display: grid; grid-template-columns: auto 1fr; gap: .65rem; margin-top: 1.2rem; padding: .9rem; border-radius: 13px; background: var(--surface-2); color: var(--muted); font-size: .8rem; }
.privacy-note p { margin: 0; }

.results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.results-toolbar { padding: .2rem .15rem .45rem; }
.sort-control { display: grid; grid-template-columns: auto minmax(160px, 220px); align-items: center; gap: .7rem; color: var(--muted); font-size: .85rem; font-weight: 700; }
.feedback-list { display: grid; gap: 1rem; }
.feedback-card { min-width: 0; padding: clamp(1.1rem, 2.5vw, 1.65rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 12px 32px rgba(30, 41, 59, .055); }
.feedback-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.card-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.badges { display: flex; flex-wrap: wrap; gap: .45rem; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: .25rem .62rem; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.badge-status { background: var(--brand-soft); color: var(--brand-strong); }
.badge-category { background: var(--surface-2); color: var(--muted); }
.badge-completed { background: color-mix(in srgb, var(--success) 14%, var(--surface)); color: var(--success); }
.badge-declined { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.card-identifiers { display: grid; justify-items: end; gap: .15rem; }
.feedback-reference { color: var(--brand-strong); font-size: .78rem; font-weight: 850; letter-spacing: .025em; }
.game-name { color: var(--muted); font-size: .82rem; font-weight: 700; text-align: right; }
.feedback-title { margin: .9rem 0 .6rem; font-size: clamp(1.15rem, 2vw, 1.45rem); letter-spacing: -.025em; }
.feedback-copy, .developer-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-copy { color: var(--text); }
.developer-response { margin-top: 1.2rem; padding: 1rem; border-left: 4px solid var(--brand); border-radius: 0 13px 13px 0; background: var(--brand-soft); }
.developer-response h4 { margin: 0 0 .45rem; font-size: .9rem; color: var(--brand-strong); }
.card-footer { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: 1.25rem; padding-top: .85rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.status-message { min-height: 1.4rem; color: var(--muted); }
.empty-state, .error-state { padding: 3rem 1.5rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.error-state { color: var(--danger); }
.skeleton { min-height: 230px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: loading 1.25s infinite; }
@keyframes loading { to { background-position: -200% 0; } }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: .5rem; }
.secondary-button { min-height: 42px; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); font-weight: 750; }
.secondary-button:disabled { opacity: .72; cursor: not-allowed; }
.site-footer { max-width: var(--max-width); margin: auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.site-footer p { margin: 0; }

@media (max-width: 850px) {
  .workspace { grid-template-columns: 1fr; }
  .filters { position: static; }
  .results-toolbar { align-items: flex-end; }
}
@media (max-width: 560px) {
  .header-inner, .header-actions { flex-wrap: wrap; }
  .brand { min-width: 0; }
  .brand strong, .hero h1, .feedback-title, .badge, .feedback-reference { overflow-wrap: anywhere; }
  .pagination > * { min-width: 0; overflow-wrap: anywhere; }
  .brand small { display: none; }
  .brand strong { font-size: .92rem; }
  .language-control select { width: 54px; color: transparent; }
  .language-control select option { color: initial; }
  .card-topline, .results-toolbar, .site-footer { flex-direction: column; }
  .card-identifiers { justify-items: start; }
  .game-name { text-align: left; }
  .sort-control { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .sort-control select { width: 100%; min-width: 0; max-width: none; }
  .pagination { flex-wrap: wrap; gap: .5rem; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}


.content-language-block {
  margin-top: 1rem;
}
.content-language-label {
  display: inline-flex;
  margin: 0 0 .7rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}
.content-heading {
  margin: 0 0 .45rem;
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.translation-divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.55rem 0 1rem;
  color: var(--brand-strong);
  font-size: .8rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.translation-divider::before,
.translation-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.english-content {
  padding-top: .1rem;
}


/* v1.3: shareable public feedback links */
.shared-view {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: .9rem;
  font-weight: 700;
}
.shared-view[hidden] { display: none; }
.shared-view .text-button { flex: 0 0 auto; }
.shared-feedback-view .filters { opacity: .78; }
.card-footer { align-items: center; justify-content: space-between; }
.card-dates { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
.copy-link-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--brand-strong);
  font-size: .78rem;
  font-weight: 800;
}
.copy-link-button:hover { border-color: var(--brand); background: var(--brand-soft); }
.copy-link-button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.copy-link-button.is-copied { border-color: var(--success); color: var(--success); }
.copy-link-button:disabled { opacity: .72; cursor: not-allowed; }
.feedback-card:focus { outline: 3px solid var(--brand); outline-offset: 3px; }
@media (max-width: 560px) {
  .shared-view, .card-footer { align-items: flex-start; flex-direction: column; }
  .copy-link-button { width: 100%; }
}

/* Public Feedback v2.0 */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.icon-button,
.secondary-button,
.text-button,
.copy-link-button,
.text-link {
  -webkit-tap-highlight-color: transparent;
}

.refresh-button.is-loading span {
  display: inline-block;
  animation: refresh-spin .8s linear infinite;
}

@keyframes refresh-spin {
  to { transform: rotate(360deg); }
}

.mobile-filter-toggle {
  display: none;
  grid-column: 1 / -1;
  justify-content: center;
  align-items: center;
  gap: .55rem;
}

.field-hint {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 500;
}

.game-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.15rem;
  align-items: center;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--brand) 14%, transparent), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow);
}

.game-context[hidden] { display: none; }

.game-context-logo-wrap {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-2);
}

.game-context-logo-wrap[hidden] { display: none; }

.game-context-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-context-copy h2 {
  font-size: clamp(1.45rem, 3vw, 2.15rem);
}

.game-context-description {
  max-width: 820px;
  margin: .55rem 0 0;
  color: var(--muted);
}

.game-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  margin-top: 1rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: .55rem .25rem;
  color: var(--brand);
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.last-updated {
  min-height: 1.15rem;
  margin: .3rem 0 0;
  color: var(--muted);
  font-size: .78rem;
}

.error-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.noscript-message {
  max-width: 760px;
  margin: 2rem auto;
  padding: 1rem;
  border: 1px solid var(--warning);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
}

.feedback-card {
  content-visibility: auto;
  contain-intrinsic-size: 330px;
}

body.is-loading .refresh-button {
  cursor: progress;
}

@media (max-width: 850px) {
  .mobile-filter-toggle { display: inline-flex; }
  .filters {
    display: none;
    top: auto;
  }
  .filters.is-open { display: block; }
}

@media (min-width: 851px) {
  .filters { display: block !important; }
}

@media (max-width: 620px) {
  .game-context {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .game-context-logo-wrap {
    width: 76px;
    height: 76px;
    border-radius: 18px;
  }
  .game-context-actions > * { width: 100%; justify-content: center; text-align: center; }
  .header-actions { gap: .35rem; }
  .icon-button { width: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .refresh-button.is-loading span { animation: none; }
}
