:root {
  color-scheme: dark light;
  --color-bg: #050a1f;
  --color-bg-accent: #0b1538;
  --color-panel: rgba(10, 17, 38, 0.82);
  --color-panel-soft: rgba(14, 24, 52, 0.75);
  --color-text: #f8fafc;
  --color-muted: #cbd5f5;
  --color-border: rgba(148, 163, 184, 0.24);
  --color-border-strong: rgba(99, 102, 241, 0.35);
  --color-accent: #60a5fa;
  --color-accent-strong: #818cf8;
  --color-correct: #22c55e;
  --color-partial: #facc15;
  --color-higher: #38bdf8;
  --color-lower: #f97316;
  --color-incorrect: #475569;
  --shadow-sm: 0 16px 45px rgba(5, 10, 31, 0.4);
  --shadow-lg: 0 32px 80px rgba(5, 10, 31, 0.6);
  --font-base: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  --page-padding-top: clamp(1.5rem, 4vh, 2.75rem);
  --page-padding-bottom: clamp(2rem, 5vh, 3rem);
  --page-padding-inline: clamp(1rem, 4vw, 2.5rem);
  margin: 0;
  font-family: var(--font-base);
  line-height: 1.6;
  background: radial-gradient(circle at 15% 15%, rgba(129, 140, 248, 0.16), transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.12), transparent 55%),
    linear-gradient(160deg, var(--color-bg), var(--color-bg-accent));
  color: var(--color-text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: var(--page-padding-top) var(--page-padding-inline) var(--page-padding-bottom);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(148, 163, 184, 0.45) rgba(5, 10, 31, 0.6);
  scrollbar-width: thin;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background: radial-gradient(circle at 10% 80%, rgba(34, 197, 94, 0.1), transparent 45%),
    radial-gradient(circle at 90% 75%, rgba(250, 204, 21, 0.08), transparent 45%);
}

body::after {
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.08), transparent 45%),
    radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.08), transparent 55%);
  mix-blend-mode: screen;
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 3vw, 2.5rem);
  min-height: calc(100vh - (var(--page-padding-top) + var(--page-padding-bottom)));
  min-height: calc(100dvh - (var(--page-padding-top) + var(--page-padding-bottom)));
}

.layout__header {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: stretch;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: 28px;
  border: 1px solid var(--color-border);
  background: linear-gradient(155deg, rgba(17, 28, 56, 0.92), rgba(11, 20, 45, 0.82));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  flex: 0 0 auto;
}

.layout__header::before {
  content: '';
  position: absolute;
  inset: -40% 20% 35% -30%;
  background: radial-gradient(circle at center, rgba(96, 165, 250, 0.35), transparent 60%);
  opacity: 0.6;
}

.layout__header::after {
  content: '';
  position: absolute;
  inset: 50% -25% -35% 40%;
  background: radial-gradient(circle at center, rgba(129, 140, 248, 0.25), transparent 60%);
  opacity: 0.7;
}

.layout__header-top,
.layout__header-content {
  position: relative;
  z-index: 1;
}

.layout__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.layout__nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(9, 16, 38, 0.65);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 45px rgba(5, 10, 31, 0.45);
}

.layout__nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  color: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.015em;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.layout__nav-link:hover {
  background: rgba(96, 165, 250, 0.16);
  transform: translateY(-1px);
}

.layout__nav-link:focus,
.layout__nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

.guess-suggestion__image,
.guess-suggestion__placeholder {
    flex-shrink: 0;
    border-radius: 12px;
}

.guess-suggestion__image {
    display: block;
    width: 72px;
    max-height: 96px;
    height: auto;
    object-fit: contain;
    background: none;
    box-shadow: none;
}

.guess-suggestion__placeholder {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.15);
    color: var(--color-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.layout__nav-link--active {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.85), rgba(129, 140, 248, 0.85));
  color: #0b1120;
  box-shadow: 0 20px 40px rgba(96, 165, 250, 0.35);
}

.layout__nav-link--completed {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.95), rgba(253, 224, 71, 0.92));
  color: #0f172a;
  box-shadow: 0 20px 40px rgba(253, 224, 71, 0.35);
}

.layout__nav-link--completed:hover {
  background: linear-gradient(135deg, rgba(253, 224, 71, 1), rgba(250, 204, 21, 0.95));
  color: #0f172a;
}

.layout__logo {
  max-width: clamp(150px, 26vw, 230px);
  width: 100%;
  height: auto;
  filter: drop-shadow(0 16px 40px rgba(15, 23, 42, 0.45));
}

.layout__header-content {
  max-width: 760px;
}

.summary-button {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(11, 20, 45, 0.65);
  color: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.65rem 1.45rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.summary-button:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 18px 35px rgba(96, 165, 250, 0.25);
}

.summary-button:focus,
.summary-button:focus-visible {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.summary-button[hidden] {
  display: none;
}

.intro {
  margin: 0;
  color: rgba(226, 232, 240, 0.9);
  font-size: clamp(1rem, 1.6vw, 1.05rem);
}

.intro--secondary {
  margin-top: 0.4rem;
  font-size: clamp(0.95rem, 1.4vw, 1rem);
  color: rgba(148, 163, 184, 0.85);
}

.mystery-description {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(226, 232, 240, 0.92);
}

.layout__content {
  gap: clamp(1.5rem, 2.5vw, 2.25rem);
  min-height: 0;
  flex: 1 1 auto;
}

.layout__content--stacked {
  display: flex;
  flex-direction: column;
}

.panel {
  position: relative;
  background: linear-gradient(160deg, var(--color-panel), rgba(11, 19, 43, 0.88));
  border: 1px solid var(--color-border);
  border-radius: 22px;
  padding: clamp(1.5rem, 2.5vw, 2rem);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  min-height: 0;
}

.panel::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 21px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  pointer-events: none;
}

.panel:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-strong);
  box-shadow: 0 24px 50px rgba(5, 10, 31, 0.55);
}

.panel--form {
  position: relative;
  z-index: 2;
  background: linear-gradient(160deg, rgba(15, 26, 56, 0.95), rgba(10, 18, 44, 0.9));
}

.panel--history {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.panel--history .panel__title {
  flex: 0 0 auto;
}

.panel--history .table-wrapper,
.panel--history .guess-history {
  flex: 1 1 auto;
  min-height: 0;
}

.panel--history .table-wrapper {
  overflow-y: auto;
  max-height: min(420px, 50vh);
}

.panel--hints {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hint-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hint-list__item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  background: rgba(12, 21, 46, 0.7);
  border: 1px solid rgba(96, 165, 250, 0.12);
}

.hint-list__label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.8);
}

.hint-list__value {
  font-size: 1.05rem;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.92);
}

.hint-list__value[data-placeholder] {
  color: rgba(148, 163, 184, 0.75);
  font-style: italic;
}

.panel__title {
  margin: 0 0 1.15rem;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}


.guess-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guess-form__label {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.95);
}

.guess-form__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: flex-start;
}

.guess-form__input-wrapper {
  position: relative;
  z-index: 2;
  flex: 1 1 1px;
  min-width: 220px;
}

.guess-form__input-wrapper::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.45), rgba(56, 189, 248, 0));
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.guess-form__input-wrapper:focus-within::before {
  opacity: 1;
}

.guess-form__input {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(9, 16, 38, 0.82);
  color: var(--color-text);
  caret-color: var(--color-accent);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.guess-form__input::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

.guess-form__input:focus,
.guess-form__input:focus-visible {
  outline: none;
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
  background: rgba(10, 18, 44, 0.95);
}

.guess-form__input:focus + .guess-suggestions,
.guess-form__input:focus-visible + .guess-suggestions {
  border-color: rgba(96, 165, 250, 0.3);
}

.guess-form__submit {
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: linear-gradient(140deg, rgba(56, 189, 248, 0.95), rgba(99, 102, 241, 0.9));
  color: #0b1120;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.guess-form__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px rgba(56, 189, 248, 0.4);
}

.guess-form__submit:focus,
.guess-form__submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.35);
}

.feedback {
  min-height: 1.5rem;
  margin: 0;
  font-size: 0.95rem;
  color: rgba(148, 163, 184, 0.9);
}

.hint {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hint__button {
  align-self: flex-start;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(9, 16, 38, 0.78);
  color: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hint__button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 18px 35px rgba(96, 165, 250, 0.25);
}

.hint__button:focus,
.hint__button:focus-visible {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.hint__button:disabled {
  cursor: default;
  opacity: 0.6;
}

.hint__button[hidden] {
  display: none;
}

.hint__content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.95);
}

.hint__content[hidden] {
  display: none;
}

.hint__entry {
  margin: 0;
}

.victory-actions {
  margin-top: 0.75rem;
}

.victory-actions__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(9, 16, 38, 0.78);
  color: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.victory-actions__button:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 18px 35px rgba(96, 165, 250, 0.25);
}

.victory-actions__button:focus,
.victory-actions__button:focus-visible {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.victory-actions__button[hidden] {
  display: none;
}

.guess-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  gap: 0.9rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
  scrollbar-color: rgba(96, 165, 250, 0.5) transparent;
  scrollbar-width: thin;
}

.guess-history__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  background: var(--color-panel-soft);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 36px rgba(8, 12, 30, 0.35);
  gap: 1rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.guess-history__item:hover {
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 20px 42px rgba(8, 12, 30, 0.45);
}

.guess-history__name {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.guess-history__status {
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.85);
}

.guess-history__item--success {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.18);
  color: #d1fae5;
}

.gallery-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

.gallery-count {
  margin: 0;
  color: rgba(226, 232, 240, 0.75);
}

.special-noel-gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
}

.special-noel-gallery__item {
  background: var(--color-panel-soft);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  box-shadow: 0 20px 42px rgba(8, 12, 30, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.special-noel-gallery__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  padding: 0.35rem;
  display: block;
  background: rgba(15, 23, 42, 0.4);
}

.special-noel-gallery__content {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.special-noel-gallery__title {
  margin: 0;
  font-size: 1.05rem;
}

.special-noel-gallery__meta,
.special-noel-gallery__details {
  margin: 0;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.9rem;
}

.reveal-panel {
  border-color: rgba(34, 197, 94, 0.45);
}

.zoom-panel {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  align-items: center;
  text-align: center;
}

.zoom-panel--empty .zoom-viewer {
  display: none;
}

.zoom-panel--empty .zoom-viewer__hint {
  color: #f87171;
}

.zoom-viewer {
  width: min(260px, 100%);
  aspect-ratio: 3 / 4;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at 30% 30%, rgba(96, 165, 250, 0.16), transparent 60%),
    rgba(9, 16, 38, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 28px 55px rgba(5, 10, 31, 0.55);
}

.zoom-viewer__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
  transition: transform 0.4s ease;
}

.zoom-viewer__hint {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.85);
}

.alternate-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.alternate-status__item {
  margin: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: rgba(226, 232, 240, 0.92);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.alternate-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.alternate-viewer__image {
  width: min(280px, 100%);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 28px 55px rgba(5, 10, 31, 0.55);
  background: radial-gradient(circle at 30% 30%, rgba(96, 165, 250, 0.16), transparent 60%),
    rgba(9, 16, 38, 0.9);
}

.alternate-viewer__hint {
  margin: 0;
  color: rgba(148, 163, 184, 0.82);
  text-align: center;
}

.victory-summary {
  margin-top: 0.75rem;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: rgba(226, 232, 240, 0.95);
  line-height: 1.5;
}


.guess-suggestions {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(8, 14, 32, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  box-shadow: 0 28px 55px rgba(5, 10, 31, 0.55);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 20;
  backdrop-filter: blur(20px);
}

.guess-suggestions[hidden] {
  display: none;
}

.guess-suggestion {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0.65rem 0.7rem;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.guess-suggestion:focus-visible,
.guess-suggestion:hover {
  background: rgba(96, 165, 250, 0.12);
  outline: none;
}

.guess-suggestion__content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.guess-suggestion__name {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.guess-suggestion__meta {
  color: rgba(226, 232, 240, 0.62);
  font-size: 0.76rem;
}

.table-wrapper {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 24px 48px rgba(5, 10, 31, 0.48);
  padding-bottom: 0.25rem;
  scrollbar-color: rgba(96, 165, 250, 0.5) transparent;
  scrollbar-width: thin;
}

.table-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  pointer-events: none;
  border: 1px solid rgba(96, 165, 250, 0.08);
}

.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(5, 10, 28, 0.75);
  backdrop-filter: blur(18px);
}

.results-table thead {
  position: sticky;
  top: 0;
  background: rgba(8, 14, 32, 0.9);
  backdrop-filter: blur(18px);
  z-index: 1;
}

.results-table th,
.results-table td {
  padding: 0.95rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}


.results-table tbody tr {
  transition: background-color 0.25s ease;
}

.results-table tbody tr:nth-child(even) {
  background: rgba(12, 20, 44, 0.55);
}

.results-table tbody tr:nth-child(odd) {
  background: rgba(8, 14, 34, 0.55);
}

.results-table tbody tr:hover {
  background: rgba(96, 165, 250, 0.16);
}

.results-table__visual-heading,
.results-table__visual {
  width: 128px;
}

.results-table__visual-heading {
  text-align: center;
}

.results-table__thumbnail {
  width: 100%;
  max-width: 116px;
  max-height: 148px;
  display: block;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(9, 16, 38, 0.75);
  box-shadow: 0 16px 32px rgba(5, 10, 31, 0.35);
  padding: 0.35rem;
  margin: 0 auto;
}

.results-table__thumbnail--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 116px;
  height: 116px;
  border-radius: 20px;
  background: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.85);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 16px 32px rgba(5, 10, 31, 0.35);
  font-family: var(--font-base);
  margin: 0 auto;
}

.results-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(148, 163, 184, 0.85);
}

.results-table thead th:nth-child(n + 3) {
  padding-left: calc(1.1rem + 1.1vw);
}

.results-table tbody tr:last-child td {
  border-bottom: none;
}

.result-cell {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.015em;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.05rem;
  background: rgba(8, 14, 34, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.result-cell__indicator {
  font-size: 0.9rem;
}

.result-cell--correct {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.5);
}

.result-cell--partial {
  background: rgba(250, 204, 21, 0.18);
  color: #fde047;
  border-color: rgba(250, 204, 21, 0.5);
}

.result-cell--higher {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
}

.result-cell--lower {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.5);
}

.result-cell--incorrect {
  background: rgba(71, 85, 105, 0.2);
  color: rgba(203, 213, 225, 0.9);
  border-color: rgba(71, 85, 105, 0.45);
}

.reveal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  align-items: center;
}

.reveal__image {
  width: min(260px, 100%);
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 28px 60px rgba(5, 10, 31, 0.55);
  background: radial-gradient(circle at 30% 30%, rgba(96, 165, 250, 0.12), transparent 65%),
    rgba(9, 16, 38, 0.85);
  padding: 0.45rem;
}

.reveal__content {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reveal__name {
  margin: 0;
  font-size: clamp(1.6rem, 2.5vw, 1.8rem);
  letter-spacing: 0.01em;
}

.reveal__meta {
  margin: -0.25rem 0 0.5rem;
  color: rgba(148, 163, 184, 0.85);
}

.reveal__description {
  margin: 0;
  line-height: 1.7;
  color: rgba(226, 232, 240, 0.9);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3rem);
  background: radial-gradient(circle at 20% 15%, rgba(129, 140, 248, 0.18), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(56, 189, 248, 0.15), transparent 55%),
    rgba(5, 10, 31, 0.78);
  backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal[hidden] {
  display: none;
}

.modal--open {
  opacity: 1;
  pointer-events: auto;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.modal__panel {
  --modal-panel-padding: clamp(2rem, 3vw, 2.4rem);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(160deg, rgba(11, 20, 45, 0.96), rgba(6, 12, 30, 0.92));
  border-radius: 28px;
  padding: var(--modal-panel-padding);
  max-width: min(640px, 100%);
  width: min(640px, 100%);
  border: 1px solid rgba(129, 140, 248, 0.28);
  box-shadow: 0 42px 95px rgba(5, 10, 31, 0.68);
  max-height: min(90vh, 720px);
  overflow: hidden;
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.modal--open .modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 1.5rem;
  overflow-y: auto;
  padding-right: clamp(0.35rem, 1vw, 0.65rem);
  margin-right: calc(clamp(0.35rem, 1vw, 0.65rem) * -1);
  scrollbar-width: thin;
  scrollbar-color: rgba(129, 140, 248, 0.45) transparent;
}

.modal__content::-webkit-scrollbar {
  width: 8px;
}

.modal__content::-webkit-scrollbar-track {
  background: transparent;
}

.modal__content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(129, 140, 248, 0.55), rgba(56, 189, 248, 0.4));
  border-radius: 999px;
}

.modal__panel::before,
.modal__panel::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 27px;
  pointer-events: none;
}

.modal__panel::before {
  background: radial-gradient(circle at top right, rgba(129, 140, 248, 0.12), transparent 55%);
  opacity: 0.85;
}

.modal__panel::after {
  border: 1px solid rgba(148, 163, 184, 0.18);
  mix-blend-mode: screen;
}

.modal__title {
  margin: 0;
  font-size: clamp(1.85rem, 3vw, 2rem);
  letter-spacing: 0.015em;
}

.modal__subtitle {
  margin: 0.5rem 0 0;
  color: rgba(148, 163, 184, 0.85);
}

.modal__streak {
  margin: 0.75rem 0 1.25rem;
  font-weight: 600;
  color: rgba(129, 140, 248, 0.95);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(8, 14, 32, 0.9);
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal__close:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(99, 102, 241, 0.35);
}

.summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.summary-list__item {
  background: rgba(12, 20, 44, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  padding: 1.35rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 18px 45px rgba(5, 10, 31, 0.45);
}

.summary-list__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.85rem;
}

.summary-list__mode {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.75);
}

.summary-list__attempts {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.8);
}

.summary-list__card {
  margin: 0;
  font-size: 1.35rem;
}

.summary-list__meta {
  margin: 0;
  color: rgba(148, 163, 184, 0.85);
  font-size: 0.95rem;
}

.summary-list__description {
  margin: 0;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.9);
}

body::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 999px;
}

body::-webkit-scrollbar-track {
  background: rgba(5, 10, 31, 0.5);
}

.table-wrapper::-webkit-scrollbar {
  height: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.55);
  border-radius: 999px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.guess-history::-webkit-scrollbar {
  height: 8px;
}

.guess-history::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.45);
  border-radius: 999px;
}

.guess-history::-webkit-scrollbar-track {
  background: transparent;
}



@media (max-width: 960px) {
  body {
    overflow-y: auto;
    display: block;
    min-height: 100%;
  }

  .layout {
    height: auto;
    min-height: auto;
    width: 100%;
  }

  .layout__content {
    overflow: visible;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 2.5vw, 2.25rem);
  }

  .panel--history .table-wrapper {
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-height: 720px) {
  body {
    overflow-y: auto;
  }

  .layout {
    height: auto;
  }

  .layout__content {
    overflow: visible;
    padding-right: 0;
  }

  .panel--history .table-wrapper {
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 900px) {
  .layout__header {
    padding: 1.75rem;
  }
}

@media (max-width: 720px) {
  body {
    padding: 1.75rem 1rem 3rem;
  }

  .layout__header-top {
    flex-direction: column;
    align-items: center;
  }

  .layout__nav {
    width: 100%;
    justify-content: center;
  }

  .layout__header-content {
    text-align: center;
  }

  .layout__header {
    padding: 1.6rem;
  }

  .panel {
    padding: 1.35rem;
  }

  .layout__content {
    gap: 1.5rem;
  }

  .guess-form__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .guess-form__submit {
    width: 100%;
  }

  .reveal {
    justify-content: center;
    text-align: center;
  }

  .reveal__content {
    align-items: center;
  }

  .modal {
    padding: 1.75rem 1.25rem;
  }

  .modal__panel {
    padding: 1.75rem;
  }
}

@media (max-width: 640px) {
  .table-wrapper {
    overflow: visible;
    padding-bottom: 0;
  }

  .panel--history .table-wrapper {
    overflow: visible;
  }

  .results-table {
    display: block;
    background: transparent;
  }

  .results-table thead {
    display: none;
  }

  .results-table tbody {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .results-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    background: rgba(8, 14, 34, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    padding: 1.1rem;
    gap: 0.9rem;
    box-shadow: 0 18px 40px rgba(5, 10, 31, 0.45);
  }

  .results-table tbody tr:nth-child(odd),
  .results-table tbody tr:nth-child(even) {
    background: none;
  }

  .results-table td,
  .results-table th[scope='row'] {
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .results-table td::before,
  .results-table th[scope='row']::before {
    content: attr(data-label);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.75);
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 0.35rem;
  }

  .results-table__visual {
    align-items: center;
  }

  .results-table__visual::before {
    margin: 0 0 0.35rem;
  }

  .results-table td[data-label='']::before {
    display: none;
  }

  .results-table__thumbnail,
  .results-table__thumbnail--placeholder {
    margin: 0;
  }

  .result-cell {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 540px) {
  .layout__nav {
    justify-content: space-between;
    gap: 0.4rem;
  }

  .layout__nav-link {
    flex: 1 1 auto;
    min-width: calc(50% - 0.4rem);
  }

  .layout__logo {
    max-width: 160px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  body {
    padding: 1.25rem 0.75rem 2.5rem;
  }

  .layout {
    gap: 1.25rem;
  }

  .layout__header {
    padding: 1.45rem;
    border-radius: 24px;
  }

  .layout__nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
  }

  .intro {
    font-size: 0.95rem;
  }

  .intro--secondary {
    font-size: 0.9rem;
  }

  .panel {
    padding: 1.15rem;
    border-radius: 18px;
  }

  .panel__title {
    font-size: 1.1rem;
  }

  .guess-form__input {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .guess-form__submit {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }

  .guess-form__label {
    font-size: 0.95rem;
  }

  .hint__button,
  .victory-actions__button,
  .summary-button {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
  }

  .result-cell {
    padding: 0.5rem 0.85rem;
    font-size: 0.95rem;
  }

  .reveal {
    gap: 1.25rem;
  }

  .reveal__image {
    max-width: 220px;
  }
}

@media (max-width: 420px) {
  .layout__nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .layout__nav-link {
    width: 100%;
  }
}

@media (max-width: 360px) {
  html {
    font-size: 14px;
  }

  body {
    padding: 1rem 0.5rem 2rem;
  }

  .layout__header {
    padding: 1.3rem;
  }

  .panel {
    padding: 1rem;
  }

  .layout__nav-link {
    font-size: 0.82rem;
    padding: 0.45rem 0.75rem;
  }

  .guess-form__input,
  .guess-form__submit {
    font-size: 0.9rem;
  }

  .result-cell {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .modal__panel {
    transform: none !important;
  }
}
