:root {
  --wood-dark: #160703;
  --wood-panel: #211007;
  --wood-panel-2: #32180b;
  --wood-line: rgba(255, 210, 138, .35);
  --gold: #ffbd4d;
  --gold-light: #ffdf9a;
  --cream: #fff0d0;
  --orange: #d78124;
  --green: #79d84a;
  --blue: #48aef0;
  --violet: #9b65ff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 198, 109, .16), transparent 24rem),
    linear-gradient(135deg, rgba(47, 18, 5, .84), rgba(14, 5, 2, .98)),
    repeating-linear-gradient(100deg, #2b1206 0 18px, #1a0903 18px 38px);
}

a {
  color: inherit;
}

.fw-black {
  font-weight: 900;
}

.place-items-center {
  place-items: center;
}

.app-shell {
  width: min(100%, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem;
}

.wide-shell {
  width: min(100%, 980px);
}

.wood-card,
.wood-bar,
.menu-button,
.stat-card,
.settings-group {
  background: linear-gradient(135deg, rgba(50, 24, 11, .96), rgba(22, 8, 3, .98));
  border: 1px solid var(--wood-line);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .42);
}

.wood-card,
.settings-group {
  border-radius: 18px;
}

.wood-bar {
  min-height: 70px;
  border-radius: 20px;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  color: #fff0d0;
  background: #d38a2b;
  text-decoration: none;
}

.brand-tile,
.mini-grid {
  display: grid;
  gap: 4px;
  aspect-ratio: 1;
}

.brand-tile {
  width: 74px;
  padding: 8px;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 1fr);
  border-radius: 18px;
  border: 1px solid #ffe4aa;
  background: linear-gradient(135deg, #ffcf88, #b9661c);
}

.brand-cell,
.mini-cell {
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #401600;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd08a, #b86117);
}

.brand-title {
  line-height: .98;
  letter-spacing: 0;
}

.brand-title span:first-child {
  display: block;
  color: var(--gold-light);
  font-size: clamp(1.85rem, 8vw, 2.45rem);
  font-weight: 900;
}

.brand-title span:last-child {
  display: block;
  color: #f3a63c;
  font-size: clamp(1.55rem, 6vw, 2.05rem);
  font-weight: 900;
}

.menu-button {
  min-height: 68px;
  border-radius: 18px;
  color: var(--cream);
  font-size: 1.15rem;
  font-weight: 900;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}

.menu-button:hover,
.theme-card:hover,
.level-card:hover {
  transform: translateY(-2px);
  color: var(--cream);
  border-color: rgba(255, 223, 154, .75);
}

.menu-button.primary {
  color: #351302;
  background: linear-gradient(135deg, #ffd07a, #d78124);
  border-color: #ffe1a3;
}

.quick-action {
  min-height: 76px;
  border-radius: 16px;
  color: var(--cream);
  text-decoration: none;
}

.quick-action i,
.menu-button i,
.section-label {
  color: var(--gold);
}

.page-title {
  color: var(--gold-light);
  font-size: clamp(1.35rem, 6vw, 1.65rem);
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .7);
}

.stat-card {
  height: 76px;
  border-radius: 16px;
}

.stat-card small,
.section-label {
  font-size: .75rem;
  font-weight: 900;
}

.stat-card strong {
  font-size: 1.35rem;
  font-weight: 900;
}

.board-frame {
  width: min(100%, 500px);
  aspect-ratio: 1;
  padding: 8px;
  border: 2px solid #b96f24;
  border-radius: 20px;
  background: rgba(36, 11, 3, .96);
  box-shadow: 0 16px 30px rgba(0, 0, 0, .55);
}

.puzzle-board {
  display: grid;
  gap: 6px;
  width: 100%;
  height: 100%;
}

.tile,
.empty-tile {
  border-radius: 8px;
}

.tile {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .35);
  color: var(--tile-text, #4b2107);
  font-size: clamp(1.7rem, 9vw, 3rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--tile-color, #f2bd72), color-mix(in srgb, var(--tile-color, #f2bd72) 72%, #000));
  box-shadow: 0 7px 12px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.tile.kids {
  border-radius: 18px;
  background:
    radial-gradient(circle at 78% 20%, rgba(255,255,255,.32) 0 16px, transparent 17px),
    linear-gradient(135deg, color-mix(in srgb, var(--tile-color) 78%, #fff), color-mix(in srgb, var(--tile-color) 82%, #ff7ab6), var(--tile-color));
}

.empty-tile {
  background: rgba(20, 5, 1, .86);
}

.action-tile {
  min-height: 74px;
  border: 1px solid rgba(123, 74, 34, .45);
  border-radius: 16px;
  color: var(--cream);
  background: rgba(42, 17, 7, .94);
}

.level-card,
.theme-card,
.daily-card {
  border-radius: 18px;
  color: var(--cream);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}

.level-card,
.daily-card {
  min-height: 112px;
  background: linear-gradient(135deg, rgba(50, 24, 11, .96), rgba(22, 8, 3, .98));
  border: 1px solid var(--wood-line);
}

.mini-grid {
  width: 76px;
  padding: 7px;
  grid-template-columns: repeat(var(--grid-size, 4), 1fr);
  border-radius: 14px;
  background: rgba(20, 5, 1, .5);
}

.mini-cell {
  min-width: 0;
  font-size: .68rem;
}

.theme-card {
  min-height: 116px;
  border: 1px solid var(--theme-accent);
  background: linear-gradient(135deg, var(--theme-start), var(--theme-end));
}

.theme-card.active {
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12), 0 14px 30px rgba(0, 0, 0, .42);
}

.theme-sample {
  display: grid;
  width: 96px;
  aspect-ratio: 1;
  padding: 7px;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .22);
}

.theme-sample span {
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--sample-text);
  font-weight: 900;
  background: var(--sample-tile);
}

.settings-row {
  min-height: 72px;
  border-bottom: 1px solid rgba(255, 210, 138, .08);
}

.settings-row:last-child {
  border-bottom: 0;
}

.form-check-input:checked {
  border-color: #7bbd2a;
  background-color: #7bbd2a;
}

.form-range::-webkit-slider-thumb {
  background: var(--gold);
}

.form-range::-moz-range-thumb {
  background: var(--gold);
}

.screenshot-strip img {
  max-height: 330px;
  border-radius: 18px;
  border: 1px solid var(--wood-line);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .4);
}

@media (max-width: 430px) {
  .app-shell {
    padding: .8rem;
  }

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

  .menu-button {
    min-height: 64px;
  }

  .brand-tile {
    width: 64px;
  }

  .action-tile {
    min-height: 68px;
  }
}
