:root {
  --bg: #d5c2a0;
  --bg-deep: #b99f77;
  --ink: #222e37;
  --ink-muted: #4f5a61;
  --panel: rgba(242, 228, 202, 0.9);
  --line: #a88d65;
  --line-strong: #8e6f43;
  --brand: #0b615a;
  --brand-2: #147b73;
  --accent: #b36a2e;
  --accent-2: #d28a46;
  --soft: #d9d9ca;
  --shadow-lg: 0 24px 52px rgba(43, 33, 20, 0.22);
  --shadow-sm: 0 9px 22px rgba(43, 33, 20, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Candara", "Trebuchet MS", sans-serif;
  line-height: 1.45;
  background:
    radial-gradient(circle at 15% 12%, rgba(46, 94, 89, 0.22), transparent 30%),
    radial-gradient(circle at 84% 18%, rgba(165, 100, 45, 0.28), transparent 32%),
    linear-gradient(180deg, rgba(38, 48, 57, 0.9) 0, rgba(38, 48, 57, 0.9) 170px, transparent 170px),
    linear-gradient(140deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0,
      rgba(255, 255, 255, 0.1) 1px,
      transparent 2px,
      transparent 11px
    ),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}

header {
  position: relative;
  padding: 1.4rem 1rem 1.2rem;
  border-bottom: 1px solid rgba(184, 157, 116, 0.68);
  background:
    linear-gradient(135deg, rgba(20, 33, 40, 0.95), rgba(32, 40, 43, 0.88)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px,
      transparent 6px
    );
  overflow: hidden;
}

header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, #0b615a, #8c8f5a 42%, #c17533 78%, #a3522f);
}

header > * {
  width: min(100%, 980px);
  margin-left: auto;
  margin-right: auto;
}

header h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  letter-spacing: 0.3px;
  font-size: clamp(2rem, 4vw, 3.05rem);
  text-wrap: balance;
  color: #f3e6cd;
  text-shadow: 0 3px 20px rgba(6, 8, 10, 0.5);
}

header p {
  margin: 0.1rem auto 0.55rem;
  color: #ddceb1;
  font-size: 1.03rem;
}

.header-actions {
  justify-content: space-between;
}

.app-version-chip {
  margin-left: auto;
  font-weight: 700;
  background: rgba(21, 33, 40, 0.58);
  color: #ddceb1;
  border-color: #8f7959;
}

.header-btn {
  border-radius: 999px;
  border-color: #8f7959;
  color: #f3e3c5;
  background: rgba(21, 33, 40, 0.58);
  padding: 0.32rem 0.9rem;
  font-size: 0.83rem;
}

.header-btn:hover {
  background: rgba(31, 48, 57, 0.8);
}

.header-btn.danger {
  border-color: #b07f44;
  color: #fbe8ca;
  background: rgba(74, 45, 24, 0.58);
}

.header-btn.danger:hover {
  background: rgba(92, 56, 30, 0.82);
}

main {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 1.25rem 1rem 2.4rem;
  display: grid;
  gap: 1.05rem;
}

.card {
  position: relative;
  background:
    linear-gradient(165deg, rgba(244, 233, 212, 0.94), rgba(232, 216, 187, 0.9)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.15rem 1.1rem 1.05rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
  animation: card-in 380ms ease both;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 245, 226, 0.95), transparent);
}

.card h2 {
  margin: 0 0 0.8rem;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: clamp(1.55rem, 2.7vw, 2rem);
  letter-spacing: 0.1px;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.catalog-tools {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.setup-filters {
  grid-template-columns: minmax(0, 320px);
}

.catalog-tools .small {
  margin: 0;
}

#difficulty-filters {
  gap: 0.45rem;
}

.filter-btn {
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  border-color: #90734a;
  background: linear-gradient(180deg, rgba(238, 224, 195, 0.95), rgba(220, 203, 168, 0.94));
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.filter-btn.active {
  border-color: #084942;
  color: #f7fffd;
  background: linear-gradient(160deg, #0b615a, #147b73);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.62rem;
  margin-bottom: 0.9rem;
}

.game-card {
  display: grid;
  gap: 0.32rem;
  text-align: left;
  align-content: start;
  padding: 0.75rem 0.8rem;
  border-color: #9f8157;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(243, 232, 209, 0.95), rgba(230, 214, 182, 0.95)),
    var(--panel);
}

.game-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.game-card strong {
  font-size: 1rem;
  line-height: 1.2;
}

.game-card.active {
  border-color: #0a5a54;
  box-shadow: 0 0 0 2px rgba(11, 97, 90, 0.2), 0 10px 22px rgba(20, 30, 37, 0.16);
  background:
    linear-gradient(180deg, rgba(225, 238, 231, 0.95), rgba(205, 229, 214, 0.95)),
    var(--panel);
}

.difficulty-badge {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid #9c855d;
  padding: 0.16rem 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 700;
}

.difficulty-easy {
  color: #0f4c30;
  background: #dce8d9;
}

.difficulty-medium {
  color: #6f460f;
  background: #eedeb8;
}

.difficulty-hard {
  color: #7c2314;
  background: #efc8b9;
}

.difficulty-unknown {
  color: #394853;
  background: #ddd8ce;
}

.journey-badge {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid #9c855d;
  padding: 0.16rem 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 700;
}

.journey-not-started {
  color: #30414d;
  background: #d9dee2;
}

.journey-in-progress {
  color: #6d4b1f;
  background: #edd8b1;
}

.journey-completed {
  color: #135032;
  background: #d2ead8;
}

.game-status-note {
  color: #36414b;
  font-weight: 600;
}

label {
  display: grid;
  gap: 0.34rem;
  font-size: 0.93rem;
  color: var(--ink-muted);
}

select,
input,
button {
  font: inherit;
  color: var(--ink);
  padding: 0.62rem 0.72rem;
  border: 1px solid #b89b71;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(250, 241, 224, 0.95), rgba(238, 225, 198, 0.95));
}

select:focus,
input:focus,
button:focus {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px rgba(11, 97, 90, 0.22);
  border-color: var(--brand);
}

button {
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 220ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 15px rgba(18, 35, 43, 0.12);
}

button:active {
  transform: translateY(0);
}

button.primary {
  border-color: #0a5a54;
  color: #f7fffd;
  background: linear-gradient(160deg, var(--brand), var(--brand-2));
}

button.primary:hover {
  border-color: #084942;
  background: linear-gradient(160deg, #0a5550, #126862);
}

button.danger {
  border-color: #9f4c3d;
  color: #fff7f3;
  background: linear-gradient(160deg, #c55f4b, #ab4634);
}

button.danger:hover {
  border-color: #8b3f31;
  background: linear-gradient(160deg, #b95240, #963b2b);
}

button.accent {
  border-color: #9f5e2f;
  color: #fff8f1;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

.progress {
  height: 13px;
  border-radius: 999px;
  border: 1px solid #bca178;
  background: rgba(246, 237, 220, 0.9);
  overflow: hidden;
  margin-top: 0.42rem;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0d6b62, #2f9a72 54%, #b9823c);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.24);
  transition: width 280ms ease;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.23rem 0.63rem;
  border-radius: 999px;
  border: 1px solid #ab9676;
  background: linear-gradient(180deg, #ebe2d1, #ddd0ba);
  font-size: 0.82rem;
  color: #2f3e47;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.54rem;
  margin-top: 0.72rem;
}

.chip-list button {
  border-radius: 999px;
  padding-inline: 0.8rem;
  background: linear-gradient(180deg, rgba(242, 232, 214, 0.95), rgba(227, 214, 189, 0.95));
}

.small {
  color: var(--ink-muted);
  font-size: 0.83rem;
}

.options {
  display: grid;
  gap: 0.52rem;
  margin: 0.7rem 0;
}

.options label {
  display: flex;
  align-items: center;
  gap: 0.46rem;
  border: 1px solid #b99f79;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(245, 234, 215, 0.92), rgba(234, 220, 193, 0.92));
  padding: 0.56rem 0.62rem;
  color: #23323c;
}

.options label.option-incorrect {
  border-color: #c94b44;
  background: linear-gradient(180deg, rgba(255, 223, 218, 0.95), rgba(244, 187, 176, 0.95));
  box-shadow: inset 0 0 0 1px rgba(171, 53, 44, 0.24);
}

.options input[type="radio"] {
  accent-color: var(--brand);
}

.lock-panel {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.safe-guide {
  margin-top: 0.45rem;
  margin-bottom: 0.62rem;
  border: 1px solid rgba(138, 116, 83, 0.72);
  border-radius: 12px;
  padding: 0.62rem 0.72rem;
  background: linear-gradient(180deg, rgba(238, 221, 189, 0.94), rgba(225, 202, 161, 0.9));
  color: #1f2a33;
}

.safe-guide p {
  margin: 0;
  color: #1a2730;
}

.safe-shell {
  margin-top: 0.52rem;
}

.safe-visual {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #4d5560;
  background: linear-gradient(160deg, #272d33, #161c22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 28px rgba(17, 21, 26, 0.34);
}

.safe-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}

.safe-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.safe-overlay > * {
  pointer-events: auto;
}

.safe-wheel-live {
  position: absolute;
  left: 62.5%;
  top: 25.1%;
  width: 22.6%;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  pointer-events: none;
}

.safe-wheel-live::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid rgba(200, 214, 229, 0.22);
  box-shadow: inset 0 0 0 2px rgba(94, 109, 126, 0.24);
  opacity: 0.46;
}

.safe-wheel-live::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16%;
  height: 16%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(circle at 38% 30%, rgba(200, 217, 236, 0.7), rgba(36, 45, 56, 0.95));
  box-shadow: 0 0 0 1px rgba(150, 169, 187, 0.25);
  opacity: 0.7;
}

.safe-visual.safe-activity .safe-wheel-live::before {
  animation: wheel-tick 240ms ease-out;
}

.safe-visual.safe-activity .safe-wheel-live::after {
  animation: wheel-core-tick 240ms ease-out;
}

.safe-visual.safe-activity-strong .safe-wheel-live::before {
  animation: wheel-turn 520ms cubic-bezier(0.25, 0.7, 0.2, 1);
}

.safe-visual.safe-activity-strong .safe-wheel-live::after {
  animation: wheel-core-turn 520ms cubic-bezier(0.25, 0.7, 0.2, 1);
}

@keyframes wheel-tick {
  0% {
    transform: rotate(0deg) scale(1);
  }
  55% {
    transform: rotate(9deg) scale(1.02);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

@keyframes wheel-core-tick {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  55% {
    transform: translate(-50%, -50%) scale(1.14);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes wheel-turn {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 0.46;
  }
  45% {
    transform: rotate(18deg) scale(1.03);
    opacity: 0.66;
  }
  100% {
    transform: rotate(0deg) scale(1);
    opacity: 0.46;
  }
}

@keyframes wheel-core-turn {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  45% {
    transform: translate(-50%, -50%) scale(1.22);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

.safe-icon-row {
  position: absolute;
  left: 10.7%;
  top: 13.3%;
  display: inline-flex;
  gap: 0.42rem;
}

.safe-icon-badge {
  width: clamp(1.5rem, 2.2vw, 1.95rem);
  height: clamp(1.5rem, 2.2vw, 1.95rem);
  border-radius: 8px;
  border: 1px solid #627182;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(64, 74, 87, 0.96), rgba(40, 47, 57, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 2px 4px rgba(8, 12, 18, 0.42);
}

.safe-icon-badge svg {
  width: 62%;
  height: 62%;
  fill: none;
  stroke: #dbe5f0;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}

.safe-screen-slot {
  position: absolute;
  left: 10.7%;
  width: 37.6%;
  height: 12.2%;
}

.safe-overlay-number .safe-screen-slot {
  top: 24.4%;
}

.safe-overlay-code .safe-screen-slot {
  top: 34%;
}

.safe-feedback {
  position: absolute;
  left: 10.7%;
  width: 37.6%;
  top: 37.4%;
  margin: 0;
  text-align: center;
  font-size: clamp(0.72rem, 1.2vw, 0.88rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffb4a9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.safe-feedback-code {
  top: 47.8%;
}

.safe-feedback.visible {
  opacity: 1;
  transform: translateY(0);
}

.lock-instructions,
.lock-meta {
  margin: 0;
  display: none;
}

.lock-code-input {
  font-family: "Consolas", "Courier New", monospace;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  font-size: 1.05rem;
  padding: 0.8rem 0.6rem;
  border: 1px solid #8f6f43;
  background: linear-gradient(180deg, rgba(249, 236, 209, 0.97), rgba(233, 213, 177, 0.95));
  max-width: 520px;
  width: 100%;
}

.safe-display-input {
  height: 100%;
  max-width: none;
  padding: 0.25rem 0.7rem;
  border-radius: 12px;
  border: 1px solid #7f8a96;
  background:
    radial-gradient(circle at 50% 22%, rgba(123, 152, 176, 0.16), transparent 52%),
    linear-gradient(180deg, #11171d, #04080c);
  color: #d9e8f4;
  font-size: clamp(1rem, 2vw, 1.6rem);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(102, 186, 255, 0.2);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

.safe-display-input::placeholder {
  color: #9eb1c0;
}

.code-display-input {
  letter-spacing: 0.18em;
}

.safe-overlay-number .safe-keypad-slot {
  position: absolute;
  left: 10.7%;
  top: 39.8%;
  width: 37.6%;
  height: 38.6%;
  padding: 1.8%;
  border-radius: 12px;
  border: 1px solid #626f7d;
  background:
    linear-gradient(180deg, rgba(31, 39, 49, 0.98), rgba(18, 24, 32, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  box-shadow: inset 0 3px 12px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.lock-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4.5%;
  align-content: stretch;
}

.safe-pad button {
  padding: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 700;
  font-size: clamp(0.88rem, 1.55vw, 1.12rem);
  color: #cfd8e2;
  border-radius: 9px;
  border: 1px solid #5f6c79;
  background:
    linear-gradient(180deg, rgba(102, 114, 129, 0.98), rgba(58, 68, 81, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 1px 2px rgba(9, 13, 18, 0.45);
}

.lock-pad button {
  padding: 0;
}

.safe-pad button:hover {
  border-color: #738292;
  background: linear-gradient(180deg, rgba(111, 123, 138, 0.99), rgba(64, 74, 88, 0.99));
}

.safe-pad button:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.safe-submit-btn {
  position: absolute;
  left: 10.7%;
  width: 37.6%;
  height: 6.7%;
  border-radius: 12px;
  border: 1px solid #758394;
  color: #e8f0f7;
  font-weight: 700;
  letter-spacing: 0.02em;
  background:
    linear-gradient(180deg, rgba(72, 102, 126, 0.98), rgba(42, 66, 88, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 14px rgba(10, 15, 20, 0.32);
  display: grid;
  place-items: center;
  padding: 0;
}

.safe-overlay-number .safe-submit-btn {
  top: 81.1%;
}

.safe-overlay-code .safe-submit-btn {
  top: 52.4%;
}

.safe-submit-btn:hover {
  border-color: #8d9dad;
  background: linear-gradient(180deg, rgba(81, 114, 140, 0.99), rgba(50, 76, 100, 0.99));
}

.safe-submit-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.45);
}

.safe-visual.safe-error {
  animation: safe-error-flash 380ms ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 2px rgba(179, 66, 49, 0.45),
    0 14px 28px rgba(17, 21, 26, 0.34);
}

@keyframes safe-error-flash {
  0% {
    transform: translateX(0);
  }
  22% {
    transform: translateX(-3px);
  }
  44% {
    transform: translateX(3px);
  }
  66% {
    transform: translateX(-2px);
  }
  100% {
    transform: translateX(0);
  }
}

.safe-submit-btn svg {
  width: clamp(1rem, 1.7vw, 1.3rem);
  height: clamp(1rem, 1.7vw, 1.3rem);
  fill: none;
  stroke: #e7f0f9;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.safe-pad button svg {
  width: clamp(0.95rem, 1.45vw, 1.12rem);
  height: clamp(0.95rem, 1.45vw, 1.12rem);
  fill: none;
  stroke: #d8e2ed;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

@media (max-width: 760px) {
  .safe-icon-row {
    top: 13.1%;
  }

  .safe-pad button {
    font-size: 0.82rem;
  }

  .safe-submit-btn {
    font-size: 0.88rem;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  .safe-shell {
    overflow: hidden;
    border-radius: 16px;
    margin-inline: -0.15rem;
  }

  .safe-visual {
    width: 100%;
    margin-left: 0;
  }

  .safe-overlay-number .safe-keypad-slot {
    top: 39.3%;
    height: 40.6%;
    padding: 1.2%;
  }

  .safe-overlay-number .safe-submit-btn {
    top: 82.3%;
    height: 7.5%;
  }

  .safe-overlay-code .safe-submit-btn {
    top: 54%;
    height: 7.8%;
  }

  .lock-pad {
    gap: 3.1%;
  }

  .safe-pad button {
    font-size: 1.02rem;
  }

  .safe-display-input {
    font-size: 1.22rem;
  }
}

#setup-card {
  border-color: #8f6f43;
  box-shadow: var(--shadow-lg);
  background:
    linear-gradient(156deg, rgba(244, 230, 205, 0.95), rgba(232, 212, 176, 0.94)),
    var(--panel);
}

#resume-hint {
  margin: 0.62rem 0 0;
}

#status-card {
  border-color: #907d5f;
  background:
    linear-gradient(165deg, rgba(221, 228, 218, 0.82), rgba(199, 205, 196, 0.8)),
    var(--panel);
}

#step-card {
  border-color: #8e6e4c;
  background:
    linear-gradient(160deg, rgba(245, 228, 193, 0.9), rgba(224, 202, 161, 0.9)),
    var(--panel);
}

#step-content p {
  margin: 0 0 0.72rem;
  color: #2b3a43;
}

.hint-box {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.hint-btn {
  width: fit-content;
  border-color: #8b6b43;
  background: linear-gradient(180deg, rgba(245, 232, 206, 0.96), rgba(227, 210, 177, 0.95));
  color: #22313a;
}

.hint-btn:hover {
  border-color: #7e5f3a;
}

.hint-panel {
  border: 1px solid #9a7a4f;
  border-radius: 12px;
  padding: 0.72rem 0.78rem;
  background: linear-gradient(165deg, rgba(238, 222, 191, 0.96), rgba(224, 205, 166, 0.95));
}

.hint-panel p {
  margin: 0 0 0.52rem;
}

.hint-panel p:last-child {
  margin-bottom: 0;
}

.hint-image {
  display: block;
  width: min(100%, 420px);
  border-radius: 10px;
  border: 1px solid #9f845e;
  margin-top: 0.45rem;
}

.clue-panel {
  margin-top: 0.85rem;
  border: 1px solid #9b7a50;
  border-radius: 12px;
  padding: 0.7rem 0.78rem;
  background: linear-gradient(165deg, rgba(238, 225, 195, 0.96), rgba(225, 205, 166, 0.95));
}

.clue-label {
  margin: 0 0 0.4rem;
  color: #2d3a43;
}

.clue-panel p {
  margin: 0 0 0.52rem;
}

.clue-panel p:last-child {
  margin-bottom: 0;
}

.clue-image {
  display: block;
  width: min(100%, 430px);
  border-radius: 10px;
  border: 1px solid #9f845e;
  margin-top: 0.46rem;
}

.skip-btn {
  border-color: #9a6a40;
  color: #2a3540;
  background: linear-gradient(180deg, rgba(241, 224, 196, 0.96), rgba(227, 204, 165, 0.95));
}

.skip-btn:hover {
  border-color: #845635;
  background: linear-gradient(180deg, rgba(236, 216, 184, 0.97), rgba(220, 194, 148, 0.96));
}

#step-card {
  position: relative;
}

.step-skip-shortcut {
  position: absolute;
  top: 0.88rem;
  right: 0.88rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  border-color: rgba(141, 107, 66, 0.66);
  background: linear-gradient(180deg, rgba(238, 220, 189, 0.92), rgba(224, 201, 164, 0.92));
  color: #374753;
  box-shadow: 0 6px 12px rgba(30, 38, 45, 0.14);
}

.step-skip-shortcut svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentColor;
}

.step-skip-shortcut:hover {
  border-color: #8a6335;
  color: #1e2b34;
  background: linear-gradient(180deg, rgba(232, 210, 173, 0.96), rgba(215, 187, 143, 0.95));
}

.confirm-popover {
  position: absolute;
  width: min(18.5rem, calc(100% - 1rem));
  border: 1px solid #8b6945;
  border-radius: 12px;
  padding: 0.72rem;
  background: linear-gradient(180deg, rgba(245, 230, 203, 0.98), rgba(229, 208, 171, 0.97));
  box-shadow: 0 10px 24px rgba(24, 31, 37, 0.24);
  z-index: 120;
}

.confirm-popover p {
  margin: 0 0 0.55rem;
  color: #1f2d37;
  font-weight: 600;
}

.confirm-actions {
  display: flex;
  gap: 0.45rem;
}

.confirm-actions button {
  flex: 1;
}

#message-card {
  border-color: #987246;
  background: linear-gradient(135deg, rgba(237, 214, 174, 0.94), rgba(219, 184, 131, 0.9));
}

#network-status {
  width: fit-content;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: #f3e3c5;
  background: rgba(21, 33, 40, 0.58);
  border-color: #8f7959;
}

#qr-video {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin-top: 0.65rem;
  box-shadow: 0 10px 20px rgba(18, 37, 45, 0.12);
}

.hidden {
  display: none !important;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  header {
    padding-top: 1.15rem;
  }

  .card {
    border-radius: 16px;
  }
}

@media (max-width: 760px) {
  .grid2 {
    grid-template-columns: 1fr;
  }

  .setup-filters {
    grid-template-columns: 1fr;
  }

  main {
    padding-top: 0.92rem;
  }

  .row button {
    flex: 1 1 100%;
  }

  #difficulty-filters button {
    flex: 0 0 auto;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .header-actions {
    align-items: stretch;
  }

  .header-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
