.odd-game {
  --odd-paper: #172335;
  --odd-surface: #111b2b;
  --odd-fg: #eef7ff;
  --odd-muted: #b6c7dd;
  --odd-mint: #9beed7;
  --odd-line: #3b4e69;
  --odd-amber: #ffd597;
  color: var(--odd-fg);
  background: var(--odd-surface);
  border: 1px solid var(--odd-line);
  border-radius: 16px;
  overflow: clip;
}

.odd-game [hidden] { display: none !important; }
.odd-game ::selection { color: #102025; background: var(--odd-mint); }
.odd-game :is(button, summary, a):focus-visible { outline: 3px solid var(--odd-amber); outline-offset: 4px; }

.odd-progress {
  display: grid;
  grid-template-columns: auto minmax(32px, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2.5vw, 32px);
  padding: 16px clamp(18px, 4vw, 38px);
  border-bottom: 1px solid var(--odd-line);
  color: var(--odd-muted);
  font-size: .875rem;
  font-weight: 670;
  font-variant-numeric: tabular-nums;
}

#odd-score { color: var(--odd-mint); }
.odd-progress progress {
  appearance: none;
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: 10px;
  color: var(--odd-mint);
  background: #2c3d55;
}
.odd-progress progress::-webkit-progress-bar { background: #2c3d55; border-radius: 10px; }
.odd-progress progress::-webkit-progress-value { background: var(--odd-mint); border-radius: 10px; }
.odd-progress progress::-moz-progress-bar { background: var(--odd-mint); border-radius: 10px; }

.odd-round, .odd-finish { padding: clamp(20px, 4vw, 40px); }
.odd-round h2, .odd-finish h2 {
  margin: 0 0 7px;
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  line-height: 1.09;
  letter-spacing: -.027em;
  text-wrap: balance;
}
.odd-round > p, .odd-finish > p { margin: 0; color: var(--odd-muted); }
.odd-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 18px);
  margin-top: clamp(20px, 3vw, 30px);
}
.odd-game button {
  min-width: 0;
  cursor: pointer;
  font-family: inherit;
}
body.arcade[data-ui] .odd-game button:disabled { cursor: default; opacity: 1; }
.odd-tile {
  --tile-face: #243956;
  --tile-edge: #506a92;
  --tile-key: #a8cff4;
  position: relative;
  display: grid;
  justify-items: start;
  align-content: space-between;
  min-height: 128px;
  gap: 10px;
  padding: clamp(12px, 1.6vw, 18px);
  border: 1px solid var(--tile-edge);
  border-radius: 13px;
  background: var(--tile-face);
  box-shadow: 0 3px 5px #080f1b8c;
  color: var(--odd-fg);
  text-align: left;
}
.odd-tile:nth-child(2) { --tile-face: #302d53; --tile-edge: #72679e; --tile-key: #dfcbff; }
.odd-tile:nth-child(3) { --tile-face: #233e44; --tile-edge: #517c81; --tile-key: #b4e9e0; }
.odd-tile:nth-child(4) { --tile-face: #392e45; --tile-edge: #7d6486; --tile-key: #f1cdec; }
.odd-tile:hover:enabled, .odd-rule:hover:enabled {
  border-color: var(--odd-fg);
  filter: brightness(1.13);
}
.odd-tile[data-mark="picked"], .odd-rule[data-mark="picked"] { outline: 2px solid var(--odd-amber); outline-offset: -3px; }
.odd-game [data-mark="right"] { --tile-key: #baffea; color: #d7fff2; background: #20473f; border-color: #86e8c9; }
.odd-game [data-mark="wrong"] { --tile-key: #ffcedb; color: #ffe5e7; background: #4d2c3c; border-color: #eb9bb0; }
.odd-marker {
  position: relative;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  margin-inline-start: auto;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.odd-tile .odd-marker { position: absolute; top: 12px; inset-inline-end: 12px; }
.odd-marker::before, .odd-marker::after {
  content: "";
  position: absolute;
}
[data-mark="right"] .odd-marker::before {
  top: 4px;
  left: 7px;
  width: 4px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
[data-mark="wrong"] .odd-marker::before, [data-mark="wrong"] .odd-marker::after {
  top: 9px;
  left: 4px;
  width: 11px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}
[data-mark="wrong"] .odd-marker::after { transform: rotate(-45deg); }
.odd-key {
  display: grid;
  place-content: center;
  min-width: 25px;
  min-height: 24px;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: 6px;
  color: var(--tile-key, #a8cff4);
  font-size: .75rem;
  font-weight: 650;
  line-height: 1;
}
.odd-label {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(1rem, 1.65vw, 1.3rem);
  font-weight: 730;
  line-height: 1.22;
  text-wrap: pretty;
}
.odd-reasons-panel {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--odd-line);
}
.odd-reasons-panel h3, .odd-result h3 { margin: 0 0 10px; font-size: clamp(1.04rem, 1.9vw, 1.25rem); }
.odd-reasons { display: grid; gap: 7px; }
.odd-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 47px;
  padding: 8px 12px;
  border: 1px solid var(--odd-line);
  border-radius: 9px;
  background: var(--odd-paper);
  color: var(--odd-fg);
  text-align: left;
  font-size: .96rem;
  line-height: 1.3;
}
.odd-rule .odd-key { flex: none; min-width: 22px; min-height: 21px; }
.odd-rule > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.odd-result {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 20px;
  padding: 17px 18px;
  border: 1px solid var(--odd-line);
  border-radius: 12px;
  background: var(--odd-paper);
  animation: odd-reveal .24s ease-out;
}
.odd-result p { max-width: 65ch; margin: 0; color: var(--odd-muted); line-height: 1.45; }
.odd-result a { display: inline-block; padding-block: 5px; color: var(--odd-mint); text-underline-offset: 3px; }
.odd-primary {
  flex: none;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid #c3faea;
  border-radius: 9px;
  color: #0a2a22;
  background: #91ecd0;
  box-shadow: 0 3px 6px #081a1875;
  font-size: .91rem;
  font-weight: 760;
}
.odd-primary:hover { background: #b0f6e2; }
.odd-finish > strong { display: block; margin: 4px 0 8px; color: var(--odd-mint); font-size: clamp(2rem, 4.5vw, 3.4rem); }
.odd-finish > button { margin-top: 20px; }
.odd-review { margin-top: 26px; border-top: 1px solid var(--odd-line); padding-top: 16px; }
.odd-review summary { cursor: pointer; color: var(--odd-fg); font-weight: 680; }
.odd-review ol { display: grid; gap: 12px; margin: 14px 0 0; padding-left: 1.6rem; }
.odd-review li { padding-block: 4px; }
.odd-review li p { margin: 4px 0 0; color: var(--odd-muted); }
.odd-review a { color: var(--odd-mint); }
.odd-guide { max-width: 72ch; }
@keyframes odd-reveal { from { opacity: .65; } to { opacity: 1; } }

@media (max-width: 1100px) {
  .odd-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .odd-tile { min-height: 98px; }
}
@media (max-width: 530px) {
  .odd-result { flex-direction: column; align-items: stretch; }
  .odd-round, .odd-finish { padding: 16px; }
  .odd-round h2 { font-size: 1.45rem; }
  .odd-tiles { margin-top: 15px; }
  .odd-tile { min-height: 76px; padding: 10px; gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .odd-result { animation: none; }
}
