/* =============================================
   PUZZLY – Cozy Puzzle App
   Design: Warm, soft, editorial. Like a beautiful
   coffee-table book came to life.
   ============================================= */

:root {
  --cream:       #f5ede0;
  --cream-dark:  #ede0cc;
  --warm-brown:  #8b6347;
  --deep-brown:  #4a2f1a;
  --terracotta:  #c17a5a;
  --sage:        #7a9e7e;
  --sage-light:  #a8c5a0;
  --gold:        #c9a84c;
  --gold-light:  #f0d080;
  --text-main:   #3d2b1a;
  --text-soft:   #8b7355;
  --text-light:  #b8a090;
  --white:       #fffdf8;
  --shadow:      rgba(74, 47, 26, 0.15);
  --shadow-deep: rgba(74, 47, 26, 0.3);

  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;

  --font-display: 'Baloo 2', 'Lato', system-ui, sans-serif;
  --font-body:    'Lato', system-ui, sans-serif;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --desktop-shell-width: min(100vw - 48px, 520px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--cream);
  font-family: var(--font-body);
  color: var(--text-main);
}

/* =============================================
   SCREENS
   ============================================= */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--cream);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

@media (min-width: 1100px) and (min-height: 760px) and (hover: hover) and (pointer: fine) {
  html, body {
    overflow: hidden;
    background:
      radial-gradient(circle at 50% 12%, rgba(255, 231, 171, 0.72), transparent 28%),
      linear-gradient(180deg, #efe4d3 0%, #e7dbc9 100%);
  }

  body {
    position: relative;
  }

  .screen {
    inset: 12px 0;
    width: var(--desktop-shell-width);
    height: calc(100dvh - 24px);
    min-height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    margin-inline: auto;
    border-radius: 36px;
    overflow: hidden auto;
    box-shadow:
      0 30px 80px rgba(74, 47, 26, 0.18),
      0 10px 26px rgba(74, 47, 26, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.72);
  }

  .home-bg {
    position: absolute;
  }

  .home-content {
    min-height: 100%;
  }

  #screen-game {
    min-height: 100%;
  }
}

/* =============================================
   HOME SCREEN
   ============================================= */

.home-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% -6%, rgba(255, 235, 170, 0.72), transparent 24%),
    radial-gradient(circle at 8% 98%, rgba(185, 219, 136, 0.3), transparent 18%),
    radial-gradient(circle at 92% 98%, rgba(255, 185, 196, 0.28), transparent 18%),
    linear-gradient(180deg, #fbf5ea 0%, #f7efe2 100%);
  pointer-events: none;
  z-index: 0;
}

.home-bg::before,
.home-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-bg::before {
  opacity: 0.42;
  background-image:
    radial-gradient(circle at 9% 14%, rgba(255,255,255,0.8) 0 2px, transparent 2px),
    radial-gradient(circle at 86% 18%, rgba(255,255,255,0.6) 0 2px, transparent 2px),
    radial-gradient(circle at 20% 74%, rgba(255,255,255,0.65) 0 2px, transparent 2px),
    radial-gradient(circle at 78% 78%, rgba(255,255,255,0.55) 0 2px, transparent 2px),
    linear-gradient(120deg, rgba(221, 205, 186, 0.2) 1px, transparent 1px),
    linear-gradient(60deg, rgba(221, 205, 186, 0.15) 1px, transparent 1px);
  background-size: auto, auto, auto, auto, 108px 108px, 108px 108px;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 10px, 54px 64px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.95), rgba(0,0,0,0.75));
}

.home-bg::after {
  display: none;
}

.home-content {
  position: relative;
  z-index: 1;
  padding: max(24px, env(safe-area-inset-top)) 20px calc(env(safe-area-inset-bottom, 20px) + 26px);
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.home-hero {
  position: relative;
  padding-top: 10px;
  text-align: center;
}

.hero-mascot-wrap {
  position: relative;
  width: min(100%, 330px);
  margin: 0 auto -16px;
}

.hero-mascot {
  width: 220px;
  height: 180px;
  margin: 0 auto;
  border-radius: 44% 44% 26% 26%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 245, 194, 0.95), rgba(255, 205, 68, 0.95) 58%, rgba(247, 176, 36, 0.95) 100%);
  box-shadow:
    0 24px 50px rgba(255, 195, 63, 0.22),
    inset 0 -16px 28px rgba(240, 172, 40, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-mascot::before,
.hero-mascot::after {
  content: "";
  position: absolute;
  top: 26px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: inherit;
  box-shadow: inherit;
}

.hero-mascot::before {
  left: 22px;
}

.hero-mascot::after {
  right: 22px;
}

.hero-mascot-image {
  position: relative;
  z-index: 1;
  width: 132px;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(120, 78, 13, 0.16));
}

.hero-spark {
  position: absolute;
  top: 42px;
  width: 34px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd56d, #ffbe28);
  box-shadow: 0 3px 8px rgba(255, 190, 40, 0.3);
}

.hero-spark-left {
  left: 28px;
  transform: rotate(-38deg);
}

.hero-spark-right {
  left: 56px;
  top: 24px;
  width: 22px;
  transform: rotate(-82deg);
}

.hero-wordmark {
  position: relative;
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 18px 22px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow:
    0 12px 32px rgba(190, 160, 122, 0.24),
    inset 0 0 0 8px rgba(255, 255, 255, 0.85);
}

.hero-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 96px;
  padding: 6px 10px;
  border-radius: 28px;
  font-family: "Baloo 2", "Trebuchet MS", var(--font-body);
  font-size: clamp(48px, 8vw, 82px);
  font-weight: 800;
  line-height: 0.92;
  color: #fffaf0;
  text-shadow: 0 4px 10px rgba(84, 49, 14, 0.14);
  box-shadow:
    inset 0 -9px 12px rgba(0, 0, 0, 0.08),
    0 9px 18px rgba(201, 161, 105, 0.18);
}

.hero-letter-p { background: linear-gradient(180deg, #ffd35f, #efb125); }
.hero-letter-u { background: linear-gradient(180deg, #ffa8c4, #ef7ca9); }
.hero-letter-z1 { background: linear-gradient(180deg, #bca0ff, #8e70dd); }
.hero-letter-z2 { background: linear-gradient(180deg, #93d7ff, #5daeea); }
.hero-letter-l { background: linear-gradient(180deg, #cde988, #9dcb52); }
.hero-letter-y { background: linear-gradient(180deg, #ffc86c, #f0a638); }

.hero-tagline {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 26px);
  color: #9273b9;
  font-weight: 600;
}

.hero-tagline::before,
.hero-tagline::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  margin: 0 14px -3px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.85), rgba(255,255,255,0.35) 32%, transparent 34%), currentColor;
  opacity: 0.35;
}

.start-menu {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-help {
  padding-bottom: 36px;
}

.home-arcade {
  padding-bottom: 24px;
}

.app-version {
  margin-top: auto;
  padding-top: 2px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(146, 116, 84, 0.62);
}

.app-version-settings {
  margin-top: 0;
  padding-top: 0;
  text-align: left;
}

.home-help-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Baloo 2", var(--font-body);
  font-size: 30px;
  font-weight: 700;
  color: #9a79ba;
  margin-bottom: 16px;
}

.home-help-title-icon {
  font-size: 28px;
  line-height: 1;
  color: #ff8db0;
}

.help-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.help-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-height: 148px;
  background: rgba(255, 250, 241, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  padding: 20px 20px 18px;
  box-shadow:
    0 14px 30px rgba(220, 196, 150, 0.2),
    inset 0 0 0 2px rgba(255,255,255,0.5);
}

.help-card-button {
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: var(--transition);
}

.help-card-button:hover,
.help-card-button:active {
  transform: translateY(-3px);
  box-shadow:
    0 18px 34px rgba(220, 196, 150, 0.24),
    inset 0 0 0 2px rgba(255,255,255,0.56);
}

.help-card h3 {
  font-family: "Baloo 2", var(--font-body);
  font-size: 20px;
  font-weight: 700;
  color: #7a552d;
  margin-bottom: 6px;
}

.help-card p {
  font-size: 14px;
  line-height: 1.55;
  color: #7f6347;
}

.help-card-copy {
  min-width: 0;
}

.help-card-icon {
  width: 74px;
  height: 74px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.55),
    0 8px 18px rgba(205, 176, 135, 0.24);
}

.help-card-icon-book {
  background: linear-gradient(180deg, #ffe392, #ffc954);
}

.help-card-icon-tip {
  background: linear-gradient(180deg, #d1ed99, #b3d36b);
}

.help-card-icon-heart {
  background: linear-gradient(180deg, #d9bef8, #ba9ce9);
}

.help-card-wide {
  grid-column: 1 / -1;
  min-height: 132px;
  background: linear-gradient(135deg, rgba(237, 223, 250, 0.88), rgba(243, 228, 245, 0.92));
}

.welcome-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(247, 239, 226, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.welcome-card {
  width: min(100%, 640px);
  padding: 24px 22px 20px;
  border-radius: 30px;
  background: rgba(255, 251, 244, 0.96);
  box-shadow:
    0 24px 46px rgba(180, 151, 118, 0.22),
    inset 0 0 0 2px rgba(255,255,255,0.65);
}

.welcome-art {
  display: block;
  width: min(180px, 42vw);
  height: auto;
  margin: 0 auto 8px;
}

.welcome-kicker {
  text-align: center;
  font-family: "Baloo 2", var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c38d42;
}

.welcome-card h2 {
  margin: 8px 0 10px;
  text-align: center;
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(30px, 5vw, 40px);
  color: #6f4d7d;
}

.welcome-copy {
  max-height: min(36vh, 260px);
  overflow-y: auto;
  padding-right: 4px;
}

.welcome-copy p {
  font-size: 16px;
  line-height: 1.6;
  color: #7f6347;
}

.release-notes-list {
  margin: 12px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: #7f6347;
}

.release-notes-list li {
  line-height: 1.5;
}

.tutorial-inline-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0.18em;
  padding: 4px 10px 4px 8px;
  border: 1px solid rgba(210, 190, 232, 0.82);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 237, 228, 0.96));
  vertical-align: middle;
  box-shadow: 0 4px 10px rgba(181, 152, 120, 0.1);
}

.tutorial-inline-button-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.tutorial-inline-button-label {
  font-family: "Baloo 2", var(--font-body);
  font-size: 0.9em;
  line-height: 1;
  color: #7d61ab;
  white-space: nowrap;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.welcome-actions .btn-primary,
.welcome-actions .btn-secondary {
  flex: 1 1 180px;
}

.menu-action {
  position: relative;
  min-height: 284px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.08));
  color: #5a3919;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 18px 22px;
  font: inherit;
  font-family: var(--font-body);
  font-size: 20px;
  cursor: pointer;
  box-shadow:
    0 18px 34px rgba(218, 190, 151, 0.24),
    inset 0 0 0 2px rgba(255,255,255,0.42);
  transition: var(--transition);
  overflow: hidden;
}

.menu-action:hover,
.menu-action:active {
  transform: translateY(-5px) scale(1.01);
  box-shadow:
    0 24px 42px rgba(204, 173, 130, 0.3),
    inset 0 0 0 2px rgba(255,255,255,0.5);
}

.primary-action {
  background: linear-gradient(135deg, rgba(255, 228, 138, 0.92), rgba(255, 218, 119, 0.75));
}

.start-menu .menu-action:nth-child(2) {
  background: linear-gradient(135deg, rgba(234, 215, 248, 0.92), rgba(226, 207, 244, 0.78));
}

.start-menu .menu-action:nth-child(3) {
  background: linear-gradient(135deg, rgba(251, 214, 220, 0.94), rgba(247, 204, 212, 0.8));
}

.start-menu .menu-action:nth-child(4) {
  background: linear-gradient(135deg, rgba(213, 232, 251, 0.94), rgba(201, 223, 247, 0.82));
}

.menu-action::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,0.2) 0 12px, transparent 12px),
    radial-gradient(circle at 80% 18%, rgba(255,255,255,0.14) 0 11px, transparent 11px),
    radial-gradient(circle at 76% 74%, rgba(255,255,255,0.18) 0 13px, transparent 13px),
    radial-gradient(circle at 14% 62%, rgba(255,255,255,0.15) 0 9px, transparent 9px);
  opacity: 0.9;
}

.menu-action > * {
  position: relative;
  z-index: 1;
}

.menu-action-deco {
  position: absolute;
  font-size: 30px;
  opacity: 0.16;
}

.start-menu .menu-action:nth-child(odd) .menu-action-deco {
  top: 26px;
  left: 28px;
}

.start-menu .menu-action:nth-child(even) .menu-action-deco {
  right: 26px;
  bottom: 48px;
}

.menu-action-icon-shell {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 251, 244, 0.9);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.68),
    0 10px 24px rgba(178, 144, 100, 0.22);
  flex-shrink: 0;
}

.menu-action-icon {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-action-icon-image {
  object-fit: contain;
}

.menu-action-title {
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.05;
}

.menu-action-subtitle {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(104, 67, 37, 0.78);
}

/* Startseite mit dem neuen Header- und Menue-Look. */
.home-bg {
  background:
    radial-gradient(circle at 50% -5%, rgba(255, 236, 179, 0.72), transparent 25%),
    radial-gradient(circle at 8% 98%, rgba(185, 219, 136, 0.28), transparent 18%),
    radial-gradient(circle at 92% 98%, rgba(255, 171, 190, 0.28), transparent 18%),
    linear-gradient(180deg, #fff7ed 0%, #f9efe2 100%);
}

.home-bg::before {
  opacity: 0.6;
  background-image:
    radial-gradient(circle at 9% 14%, rgba(255, 255, 255, 0.86) 0 2px, transparent 2px),
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.72) 0 2px, transparent 2px),
    radial-gradient(circle at 20% 74%, rgba(255, 255, 255, 0.78) 0 2px, transparent 2px),
    radial-gradient(circle at 78% 78%, rgba(255, 255, 255, 0.66) 0 2px, transparent 2px),
    linear-gradient(120deg, rgba(221, 205, 186, 0.15) 1px, transparent 1px),
    linear-gradient(60deg, rgba(221, 205, 186, 0.12) 1px, transparent 1px);
}

.home-content {
  max-width: 860px;
  gap: 22px;
  padding-inline: clamp(16px, 4vw, 36px);
}

.home-hero {
  padding-top: 0;
  margin-inline: calc(clamp(16px, 4vw, 36px) * -1);
}

.hero-header-image {
  display: block;
  width: min(100%, 920px);
  height: auto;
  margin: -4px auto -12px;
  filter: drop-shadow(0 18px 34px rgba(183, 145, 95, 0.12));
}

.hero-tagline {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.6vw, 14px);
  width: min(100%, calc(100vw - 28px));
  margin-inline: auto;
  padding: 3px 4px 5px;
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(18px, 4vw, 29px);
  font-weight: 700;
  line-height: 1.35;
  color: #9b79c4;
}

.hero-tagline::before,
.hero-tagline::after {
  flex: 0 0 auto;
  margin: 0;
}

.hero-tagline::before {
  color: #ff8eaa;
  opacity: 0.78;
}

.hero-tagline::after {
  color: #9b79e4;
  opacity: 0.72;
}

.start-menu {
  gap: clamp(14px, 3vw, 24px);
}

.menu-action {
  min-height: clamp(230px, 30vw, 286px);
  border-radius: 30px;
  border-color: rgba(255, 255, 255, 0.76);
  gap: 10px;
  padding: 26px 18px 24px;
  box-shadow:
    0 16px 30px rgba(206, 176, 132, 0.24),
    inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.menu-action::before {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.24) 0 10px, transparent 11px),
    radial-gradient(circle at 82% 26%, rgba(255, 255, 255, 0.16) 0 9px, transparent 10px),
    radial-gradient(circle at 83% 74%, rgba(255, 255, 255, 0.2) 0 11px, transparent 12px),
    radial-gradient(circle at 16% 64%, rgba(255, 255, 255, 0.16) 0 8px, transparent 9px);
}

.menu-action-deco {
  display: none;
}

.menu-action-icon-shell {
  width: clamp(104px, 16vw, 132px);
  height: clamp(104px, 16vw, 132px);
  background: transparent;
  box-shadow: none;
}

.menu-action-icon {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 15px rgba(154, 116, 75, 0.16));
}

.menu-action-title {
  color: #5b3a1f;
  font-size: clamp(24px, 3.5vw, 31px);
}

.menu-action-subtitle {
  font-size: clamp(14px, 2.2vw, 18px);
  color: rgba(106, 67, 38, 0.78);
}

.start-menu .menu-action:nth-child(4) .menu-action-subtitle {
  color: rgba(56, 101, 146, 0.86);
}

.home-help {
  padding-bottom: 18px;
}

.home-help-title {
  margin-top: 4px;
  margin-bottom: 14px;
  font-size: clamp(25px, 4vw, 31px);
}

.help-card {
  border-radius: 24px;
  min-height: 142px;
  padding: 22px 20px;
}

.help-card h3 {
  font-size: clamp(20px, 3vw, 25px);
}

.help-card p {
  font-size: clamp(14px, 2.1vw, 17px);
}

.help-card-wide {
  min-height: 126px;
}

/* Kategorienraster */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.category-grid-large {
  padding: 20px;
}

.category-card {
  background: var(--white);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 12px var(--shadow);
}

.category-grid-large .category-card {
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.category-card:hover,
.category-card:active {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--shadow-deep);
  border-color: var(--terracotta);
}

.category-card.selected {
  border-color: var(--terracotta);
  background: rgba(193, 122, 90, 0.06);
}

.category-emoji {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.category-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.category-count {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.category-stars {
  margin-top: 10px;
  justify-content: center;
}

.category-stars .star-btn {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

/* Kategorienansicht */
#screen-browse {
  background:
    linear-gradient(180deg, rgba(255, 248, 237, 0.96), rgba(250, 240, 226, 0.98)),
    var(--cream);
}

#screen-browse::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(120deg, rgba(221, 205, 186, 0.22) 1px, transparent 1px),
    linear-gradient(60deg, rgba(221, 205, 186, 0.16) 1px, transparent 1px);
  background-size: 108px 108px;
  background-position: 0 18px, 54px 72px;
}

#screen-browse .screen-header {
  overflow: hidden;
}

#screen-browse .screen-header h2 {
  margin-top: -4px;
}

#screen-browse .browse-options,
#screen-browse .category-grid-large {
  position: relative;
  z-index: 1;
  width: min(100%, 1100px);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 42px);
}

#screen-browse .browse-options {
  margin-top: 0;
  padding-top: 12px;
}

#screen-browse .browse-options h3 {
  margin-bottom: 16px;
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(25px, 3.4vw, 31px);
  font-weight: 600;
  color: #795585;
}

#screen-browse .grid-selector {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 24px);
}

#screen-browse .grid-btn {
  min-height: 74px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
  color: #6a4a78;
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  box-shadow:
    0 8px 18px rgba(110, 78, 53, 0.12),
    inset 0 0 0 2px rgba(255, 245, 232, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 16px);
}

#screen-browse .grid-btn-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: 5px;
  background:
    linear-gradient(#b78ec2 0 0) 0 0 / 8px 8px no-repeat,
    linear-gradient(#b78ec2 0 0) 11px 0 / 8px 8px no-repeat,
    linear-gradient(#b78ec2 0 0) 22px 0 / 8px 8px no-repeat,
    linear-gradient(#b78ec2 0 0) 0 11px / 8px 8px no-repeat,
    linear-gradient(#b78ec2 0 0) 11px 11px / 8px 8px no-repeat,
    linear-gradient(#b78ec2 0 0) 22px 11px / 8px 8px no-repeat,
    linear-gradient(#b78ec2 0 0) 0 22px / 8px 8px no-repeat,
    linear-gradient(#b78ec2 0 0) 11px 22px / 8px 8px no-repeat,
    linear-gradient(#b78ec2 0 0) 22px 22px / 8px 8px no-repeat;
}

#screen-browse .grid-btn.active {
  background: linear-gradient(180deg, #c991ee, #ad71d8);
  color: #fffdf8;
  box-shadow:
    0 8px 18px rgba(121, 76, 157, 0.28),
    inset 0 -4px 0 rgba(91, 54, 126, 0.14);
}

#screen-browse .grid-btn.active .grid-btn-icon {
  background:
    linear-gradient(#fffdf8 0 0) 0 0 / 8px 8px no-repeat,
    linear-gradient(#fffdf8 0 0) 11px 0 / 8px 8px no-repeat,
    linear-gradient(#fffdf8 0 0) 22px 0 / 8px 8px no-repeat,
    linear-gradient(#fffdf8 0 0) 0 11px / 8px 8px no-repeat,
    linear-gradient(#fffdf8 0 0) 11px 11px / 8px 8px no-repeat,
    linear-gradient(#fffdf8 0 0) 22px 11px / 8px 8px no-repeat,
    linear-gradient(#fffdf8 0 0) 0 22px / 8px 8px no-repeat,
    linear-gradient(#fffdf8 0 0) 11px 22px / 8px 8px no-repeat,
    linear-gradient(#fffdf8 0 0) 22px 22px / 8px 8px no-repeat;
}

#screen-browse .custom-grid-row {
  margin-top: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(150, 115, 87, 0.12);
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(21px, 3vw, 29px);
  color: #795585;
}

#screen-browse .custom-grid-inputs {
  gap: clamp(12px, 2vw, 24px);
}

#screen-browse .custom-grid-inputs input {
  width: clamp(84px, 12vw, 120px);
  height: 64px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.94);
  color: #795585;
  font-family: "Baloo 2", var(--font-body);
  font-size: 25px;
  box-shadow:
    0 8px 18px rgba(110, 78, 53, 0.1),
    inset 0 0 0 1px rgba(226, 210, 192, 0.5);
}

#screen-browse .category-grid-large {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.2vw, 28px);
  padding-top: 14px;
  padding-bottom: 46px;
}

#screen-browse .category-card {
  min-height: 292px;
  border: 2px solid rgba(255, 253, 248, 0.92);
  border-radius: 28px;
  padding: 26px 20px 20px;
  background: rgba(255, 253, 248, 0.84);
  box-shadow:
    0 10px 24px rgba(128, 91, 63, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

#screen-browse .category-card[data-cat-id="landscapes"] { background: linear-gradient(180deg, rgba(255,253,248,0.92), rgba(247, 255, 243, 0.84)); }
#screen-browse .category-card[data-cat-id="doors"] { background: linear-gradient(180deg, rgba(255,253,248,0.92), rgba(255, 246, 234, 0.86)); }
#screen-browse .category-card[data-cat-id="butterflies"] { background: linear-gradient(180deg, rgba(255,253,248,0.92), rgba(255, 239, 244, 0.84)); }
#screen-browse .category-card[data-cat-id="abstractarchitecture"] { background: linear-gradient(180deg, rgba(255,253,248,0.92), rgba(246, 238, 255, 0.84)); }
#screen-browse .category-card[data-cat-id="lensball"] { background: linear-gradient(180deg, rgba(255,253,248,0.92), rgba(236, 247, 255, 0.84)); }
#screen-browse .category-card[data-cat-id="planets"] { background: linear-gradient(180deg, rgba(255,251,244,0.95), rgba(255, 247, 236, 0.88)); }
#screen-browse .category-card[data-cat-id="unicorns"] { background: linear-gradient(180deg, rgba(255,253,248,0.92), rgba(255, 239, 248, 0.84)); }
#screen-browse .category-card[data-cat-id="famousart"] { background: linear-gradient(180deg, rgba(255,253,248,0.92), rgba(255, 250, 229, 0.84)); }
#screen-browse .category-card[data-cat-id="shadows"] { background: linear-gradient(180deg, rgba(255,253,248,0.92), rgba(244, 243, 252, 0.84)); }
#screen-browse .category-card[data-cat-id="symmetrie"] { background: linear-gradient(180deg, rgba(255,253,248,0.92), rgba(241, 252, 245, 0.84)); }

#screen-browse .category-card:hover,
#screen-browse .category-card:active {
  border-color: rgba(255, 178, 135, 0.78);
  box-shadow:
    0 16px 30px rgba(128, 91, 63, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.68);
}

#screen-browse .category-card.selected {
  border-color: #ffb184;
  background: rgba(255, 250, 243, 0.92);
  box-shadow:
    0 16px 30px rgba(255, 177, 132, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

#screen-browse .category-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#screen-browse .category-emoji-wrap {
  width: 112px;
  height: 112px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 38%, rgba(255, 242, 218, 0.96), rgba(236, 223, 250, 0.82));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.55),
    0 8px 16px rgba(103, 74, 50, 0.08);
}

#screen-browse .category-card[data-cat-id="landscapes"] .category-emoji-wrap { background: radial-gradient(circle at 45% 35%, #f0ffe0, #d6efb7); }
#screen-browse .category-card[data-cat-id="doors"] .category-emoji-wrap { background: radial-gradient(circle at 45% 35%, #fff0d5, #ffe3b8); }
#screen-browse .category-card[data-cat-id="butterflies"] .category-emoji-wrap { background: radial-gradient(circle at 45% 35%, #ffe9ee, #ffd7df); }
#screen-browse .category-card[data-cat-id="abstractarchitecture"] .category-emoji-wrap { background: radial-gradient(circle at 45% 35%, #efe6ff, #e2d2fb); }
#screen-browse .category-card[data-cat-id="lensball"] .category-emoji-wrap { background: radial-gradient(circle at 45% 35%, #e0f3ff, #d3e8ff); }
#screen-browse .category-card[data-cat-id="planets"] .category-emoji-wrap { background: radial-gradient(circle at 45% 35%, #fff0d6, #ffe5b6); }
#screen-browse .category-card[data-cat-id="unicorns"] .category-emoji-wrap { background: radial-gradient(circle at 45% 35%, #ffe6f1, #f7d9f5); }
#screen-browse .category-card[data-cat-id="famousart"] .category-emoji-wrap { background: radial-gradient(circle at 45% 35%, #fff4cf, #ffe39d); }
#screen-browse .category-card[data-cat-id="shadows"] .category-emoji-wrap { background: radial-gradient(circle at 45% 35%, #ece8ff, #dcd6f4); }
#screen-browse .category-card[data-cat-id="symmetrie"] .category-emoji-wrap { background: radial-gradient(circle at 45% 35%, #e9fff2, #d9f0de); }

#screen-browse .category-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 76px;
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(103, 74, 50, 0.16));
}

#screen-browse .category-icon-image {
  width: 82px;
  height: 82px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 10px rgba(103, 74, 50, 0.16));
}

#screen-browse .category-card.has-custom-icon .category-emoji-wrap {
  background: transparent;
  box-shadow: none;
}

#screen-browse .category-name {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #62446b;
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  text-transform: uppercase;
}

#screen-browse .category-count {
  margin-top: 4px;
  color: #9b7897;
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(17px, 2.3vw, 22px);
}

#screen-browse .category-stars {
  margin-top: 20px;
  gap: 10px;
}

#screen-browse .category-stars .star-btn {
  width: 39px;
  height: 39px;
  border: 1px solid rgba(232, 207, 188, 0.8);
  background: rgba(255, 253, 248, 0.78);
  color: rgba(216, 185, 164, 0.78);
  font-size: 19px;
  box-shadow: 0 4px 8px rgba(114, 82, 54, 0.06);
}

#screen-browse .category-stars .star-btn.active {
  background: rgba(255, 253, 248, 0.92);
  border-color: rgba(255, 177, 56, 0.45);
  color: #ffad21;
  box-shadow: 0 6px 10px rgba(255, 174, 37, 0.14);
}

/* Rasterauswahl */
.grid-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.custom-grid-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  font-size: 13px;
}

.custom-grid-inputs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.custom-grid-inputs input,
.preset-editor-item input {
  width: 64px;
  padding: 10px 8px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-main);
  font: inherit;
  text-align: center;
}

.browse-options,
.settings-section,
.record-replay-controls {
  padding: 18px 20px 0;
}

.browse-options h3,
.settings-section h3,
.record-replay-controls h3 {
  font-family: var(--font-display);
  color: var(--warm-brown);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 10px;
}

.grid-btn {
  flex: 1;
  min-width: 52px;
  padding: 10px 8px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
}

.grid-btn:hover { border-color: var(--terracotta); color: var(--terracotta); }

.grid-btn.active {
  border-color: var(--terracotta);
  background: var(--terracotta);
  color: var(--white);
}

/* Primaerer Button */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--terracotta), var(--warm-brown));
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(193, 122, 90, 0.4);
  letter-spacing: 0.3px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(193, 122, 90, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--warm-brown);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 17px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: var(--warm-brown);
}

/* Untere Aktionsleiste */
.bottom-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px 0 24px;
  margin-top: auto;
}

.icon-btn {
  background: var(--white);
  border: 2px solid var(--cream-dark);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 22px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--shadow);
}

.game-lock-btn {
  width: auto;
  min-width: 132px;
  min-height: 74px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(210, 190, 232, 0.8);
  background: linear-gradient(180deg, rgba(232, 212, 247, 0.92), rgba(215, 188, 240, 0.94));
  color: #8366b2;
  font-family: "Baloo 2", var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 10px 20px rgba(176, 146, 205, 0.14);
}

.game-lock-btn::before {
  content: "🔒";
  margin-right: 10px;
  font-size: 18px;
}

.game-lock-btn.is-unlocked {
  border-color: rgba(255, 205, 111, 0.82);
  background: linear-gradient(180deg, rgba(255, 239, 195, 0.92), rgba(255, 225, 153, 0.95));
  color: #b07a2f;
}

.game-lock-btn.is-unlocked::before {
  content: "🔓";
}

.icon-btn:hover {
  transform: scale(1.1);
  border-color: var(--terracotta);
}

.icon-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-image {
  display: none;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.icon-image-lg {
  width: 56px;
  height: 56px;
}

.icon-image-xl {
  width: 56px;
  height: 56px;
}

.icon-btn .icon-glyph,
.back-btn .icon-glyph {
  font-size: 22px;
}

.back-btn,
.icon-btn,
.logo-icon,
.win-emoji {
  position: relative;
}

.icon-has-image .icon-glyph {
  display: none;
}

.icon-has-image .icon-image {
  display: block;
}

/* =============================================
   SCREEN HEADERS
   ============================================= */

.screen-header,
.game-header {
  position: relative;
  flex-shrink: 0;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 34px) 18px;
  background:
    linear-gradient(180deg, rgba(255, 248, 237, 0.98), rgba(255, 248, 237, 0.88)),
    #fff7ed;
  border-bottom: 0;
  z-index: 3;
}

.subpage-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subpage-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.subpage-header h2 {
  margin: 0;
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 800;
  line-height: 1;
  color: #6b4a78;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.72);
}

.subpage-header-art {
  width: clamp(96px, 16vw, 172px);
  flex: 0 0 auto;
  pointer-events: none;
}

.subpage-header-image {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(231, 190, 103, 0.12));
}

.back-btn {
  background: transparent;
  border: 0;
  font-size: 24px;
  cursor: pointer;
  color: #a87dcb;
  padding: 0;
  border-radius: 50%;
  transition: var(--transition);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  box-shadow: none;
}

.back-btn .icon-glyph {
  font-size: 34px;
  font-weight: 800;
}

.back-btn .icon-image {
  width: 64px;
  height: 64px;
}

.back-btn:hover { background: transparent; }

/* =============================================
   BROWSE SCREEN
   ============================================= */

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 20px;
  overflow-y: auto;
}

.puzzle-thumb {
  background: var(--white);
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 12px var(--shadow);
  position: relative;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
}

.puzzle-thumb:hover, .puzzle-thumb:active {
  transform: scale(1.03);
  box-shadow: 0 8px 24px var(--shadow-deep);
}

.puzzle-thumb img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.puzzle-thumb-info {
  padding: 10px 12px;
}

.puzzle-thumb-name {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--deep-brown);
  font-weight: 600;
}

.puzzle-thumb-artist {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 2px;
}

.puzzle-thumb-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--gold);
  color: var(--deep-brown);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 20px;
}

/* =============================================
   GAME SCREEN
   ============================================= */

#screen-game {
  position: absolute;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 233, 176, 0.58), transparent 24%),
    linear-gradient(180deg, #fdf6ea 0%, #f9efe2 100%);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#screen-game::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(120deg, rgba(221, 205, 186, 0.16) 1px, transparent 1px),
    linear-gradient(60deg, rgba(221, 205, 186, 0.12) 1px, transparent 1px);
  background-size: 108px 108px;
  background-position: 0 18px, 54px 72px;
}

.game-header {
  z-index: 10;
}

.game-header-top {
  align-items: flex-start;
}

.game-header-leading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.game-grid-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-top: 4px;
  min-width: 0;
}

.game-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 clamp(18px, 4vw, 34px) 10px;
}

.game-toolbar-actions {
  justify-content: center;
}

.game-toolbar-back {
  display: none;
}

#screen-game .icon-btn,
#screen-game .back-btn {
  min-width: 64px;
  min-height: 64px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a87dcb;
  box-shadow: none;
}

#screen-game .back-btn .icon-glyph,
#screen-game .icon-btn .icon-glyph {
  font-size: 34px;
  font-weight: 800;
}

#screen-game .icon-btn .icon-image,
#screen-game .back-btn .icon-image {
  width: 64px;
  height: 64px;
}

#screen-game .game-lock-btn {
  min-width: 64px;
  width: 64px;
  min-height: 64px;
  height: 64px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#screen-game .game-lock-btn::before {
  content: none;
}

#group-lock-label-toolbar,
#btn-toggle-auto-toolbar .auto-mode-label {
  display: none;
}

.game-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#screen-game .icon-btn.is-disabled {
  opacity: 0.45;
  cursor: default;
}

#screen-game #btn-next-puzzle,
#screen-game #btn-next-puzzle-toolbar {
  color: #9e76c9;
}

.game-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 180px;
  align-self: center;
  padding: 14px 20px;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.92);
  box-shadow:
    0 10px 24px rgba(185, 153, 108, 0.16),
    inset 0 0 0 2px rgba(255,255,255,0.68);
}

.timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(28px, 4vw, 42px);
  color: #7d61ab;
  letter-spacing: 0;
  font-weight: 800;
}

.timer::before {
  content: "⏱";
  font-size: 0.72em;
  color: #ffba32;
}

.game-grid-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  font-family: "Baloo 2", var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: #8f7357;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(193, 122, 90, 0.16);
}

.game-grid-label::after {
  content: "▾";
  font-size: 0.8em;
  color: #c17a5a;
}

.game-grid-label:hover {
  color: var(--terracotta);
}

.game-grid-label:focus-visible {
  outline: 2px solid rgba(193, 122, 90, 0.45);
  outline-offset: 2px;
}

.game-grid-switcher {
  position: relative;
}

.game-category-label {
  max-width: 220px;
  padding-left: 4px;
  font-size: 12px;
  line-height: 1.2;
  color: #9b836d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-grid-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 180px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow:
    0 18px 38px rgba(74, 47, 26, 0.18),
    inset 0 0 0 1px rgba(255,255,255,0.85);
}

.game-grid-menu.hidden {
  display: none;
}

.game-grid-menu-title {
  padding: 0 2px 4px;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.game-grid-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid rgba(193, 122, 90, 0.2);
  border-radius: 14px;
  background: rgba(255,255,255,0.78);
  font-family: "Baloo 2", var(--font-body);
  font-size: 18px;
  color: #8f7357;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), color var(--transition), background var(--transition);
}

.game-grid-option:hover {
  transform: translateY(-1px);
  border-color: rgba(193, 122, 90, 0.45);
  color: var(--terracotta);
}

.game-grid-option.active {
  background: rgba(193, 122, 90, 0.12);
  border-color: rgba(193, 122, 90, 0.55);
  color: var(--terracotta);
}

.puzzle-container {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 0 clamp(18px, 4vw, 34px) 12px;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}

#puzzle-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 28px;
  border: 10px solid rgba(255, 252, 247, 0.9);
  background: rgba(255,255,255,0.28);
  box-shadow:
    0 18px 38px rgba(191, 159, 118, 0.22),
    inset 0 0 0 1px rgba(255,255,255,0.42);
  cursor: pointer;
  touch-action: none;
}

@media (hover: none), (pointer: coarse) {
  .puzzle-container {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  #puzzle-canvas {
    display: block;
    margin-inline: auto;
    max-height: none;
  }
}

.pause-overlay {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(245, 237, 224, 0.34);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
  z-index: 2;
}

.image-preview-overlay {
  position: absolute;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(61, 43, 26, 0.26);
  backdrop-filter: blur(10px) saturate(1.02);
  -webkit-backdrop-filter: blur(10px) saturate(1.02);
  z-index: 3;
}

.image-preview-card {
  width: min(100%, 860px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.image-preview-close {
  align-self: flex-end;
  min-height: 46px;
  padding-inline: 16px;
}

.image-preview-full {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(78dvh, 100%);
  object-fit: contain;
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow:
    0 20px 46px rgba(74, 47, 26, 0.24),
    inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.pause-card {
  max-width: 340px;
  width: 100%;
  padding: 24px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(255, 253, 248, 0.72);
  box-shadow: 0 18px 42px rgba(74, 47, 26, 0.2);
  text-align: center;
}

.pause-kicker {
  margin-bottom: 8px;
  color: var(--terracotta);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pause-card h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--deep-brown);
}

.pause-text {
  margin-top: 10px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}

.pause-resume-btn {
  margin-top: 18px;
}

#screen-game.is-paused #puzzle-canvas {
  filter: blur(9px) saturate(0.8) brightness(0.86);
  transform: scale(1.015);
}

#screen-game.is-paused #btn-pause-game,
#screen-game.is-paused #btn-pause-game-toolbar {
  border-color: var(--terracotta);
  background: rgba(193, 122, 90, 0.1);
}

.game-footer {
  position: relative;
  z-index: 1;
  margin: 0 clamp(18px, 4vw, 34px) max(18px, env(safe-area-inset-bottom));
  padding: 24px 24px 22px;
  border-radius: 30px;
  background: rgba(255, 251, 244, 0.88);
  box-shadow:
    0 18px 34px rgba(202, 172, 135, 0.16),
    inset 0 0 0 2px rgba(255,255,255,0.6);
  flex-shrink: 0;
}

#screen-donate {
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 233, 176, 0.52), transparent 24%),
    linear-gradient(180deg, #fdf6ea 0%, #f9efe2 100%);
}

.donation-view {
  padding: 12px clamp(18px, 4vw, 34px) 34px;
  display: grid;
  gap: 18px;
}

.donation-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.donation-card {
  background: rgba(255, 250, 241, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  padding: 22px 22px 20px;
  box-shadow:
    0 14px 30px rgba(220, 196, 150, 0.18),
    inset 0 0 0 2px rgba(255,255,255,0.48);
}

.donation-card h3 {
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.05;
  color: #6f4d7d;
  margin-bottom: 10px;
}

.donation-card p,
.donation-note {
  font-size: 17px;
  line-height: 1.55;
  color: #8d7559;
}

.donation-actions-card {
  display: grid;
  gap: 14px;
}

.game-support {
  margin-top: 18px;
}

.game-support-toggle {
  min-height: 62px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 232, 171, 0.72), rgba(255, 221, 133, 0.84));
  border-color: rgba(255, 210, 116, 0.75);
  color: #8b69bf;
  font-family: "Baloo 2", var(--font-body);
  font-size: 19px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(221, 181, 114, 0.16);
}

.game-support-toggle::before {
  content: "⚑";
  margin-right: 12px;
}

.game-support-panel {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(241, 220, 193, 0.85);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.9);
}

.game-support-title {
  margin: 12px 0 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--warm-brown);
}

.image-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
  text-align: left;
}

.image-info::before {
  content: none;
}

.image-name {
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(28px, 4vw, 38px);
  color: #7a61ab;
  font-style: normal;
  font-weight: 700;
  text-decoration: none;
}

.image-name.is-link:hover {
  color: #634d99;
}

.image-artist {
  margin-top: 2px;
  font-size: 18px;
  color: #7b6449;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.image-artist.is-link,
.record-artist-link {
  color: var(--warm-brown);
  text-decoration: underline;
  text-decoration-color: rgba(139, 99, 71, 0.45);
}

.image-artist.is-link:hover,
.record-artist-link:hover {
  color: var(--terracotta);
}

.image-desc {
  margin-top: 6px;
  font-size: 17px;
  line-height: 1.45;
  color: #8d7559;
  max-width: 720px;
}

/* =============================================
   RECORDS SCREEN
   ============================================= */

.records-list {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#screen-sticker-album,
#screen-arcade-challenges,
#screen-time-challenge,
#screen-unlock-journey {
  position: absolute;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 234, 181, 0.56), transparent 24%),
    linear-gradient(180deg, #fdf6ea 0%, #f8efe2 100%);
  overflow: hidden;
}

.arcade-view {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.arcade-card {
  background: rgba(255, 251, 244, 0.92);
  border-radius: 26px;
  padding: 20px 22px;
  box-shadow:
    0 14px 26px rgba(202, 172, 135, 0.12),
    inset 0 0 0 2px rgba(255,255,255,0.6);
}

.arcade-card-lead h3 {
  font-family: "Baloo 2", var(--font-body);
  font-size: 28px;
  color: #6f4d7d;
  margin-bottom: 10px;
}

.arcade-card-lead p {
  color: #8b7355;
  line-height: 1.55;
  margin-bottom: 16px;
}

.arcade-progress-stat {
  font-family: "Baloo 2", var(--font-body);
  font-size: 28px;
  line-height: 1.1;
  color: var(--terracotta);
}

.arcade-progress-sub {
  margin-top: 6px;
  color: #8d7559;
  font-size: 15px;
}

.arcade-challenge-list {
  display: grid;
  gap: 12px;
}

.arcade-challenge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(238, 222, 198, 0.9);
}

.arcade-challenge-item.is-complete {
  background: linear-gradient(180deg, rgba(255,250,238,0.96), rgba(246,255,242,0.92));
  border-color: rgba(189, 212, 176, 0.92);
}

.arcade-challenge-copy h3,
.sticker-album-copy h3 {
  font-family: "Baloo 2", var(--font-body);
  font-size: 20px;
  color: #6f4d7d;
  line-height: 1.12;
}

.arcade-challenge-copy p,
.sticker-album-copy p {
  margin-top: 4px;
  color: #8d7559;
  font-size: 14px;
  line-height: 1.4;
}

.arcade-challenge-reward {
  flex-shrink: 0;
}

.arcade-reward-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 8px 20px rgba(193, 122, 90, 0.18);
}

.arcade-reward-thumb.is-locked {
  filter: grayscale(1);
  opacity: 0.42;
}

.arcade-reward-fallback {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  color: #b59e87;
  font-family: "Baloo 2", var(--font-body);
  font-size: 30px;
}

.unlock-journey-view {
  gap: 14px;
}

.unlock-journey-board-card {
  align-items: stretch;
}

.unlock-journey-board {
  display: grid;
  grid-template-columns: repeat(var(--unlock-cols, 3), minmax(0, 1fr));
  grid-template-rows: repeat(var(--unlock-rows, 3), minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 560px);
  aspect-ratio: var(--unlock-image-aspect, 1);
  margin: 18px auto 0;
}

.arcade-overview-actions {
  display: grid;
  gap: 12px;
}

.arcade-challenge-groups {
  display: grid;
  gap: 18px;
}

.arcade-challenge-group {
  display: grid;
  gap: 12px;
}

.arcade-challenge-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.arcade-challenge-group-copy h3 {
  font-family: "Baloo 2", var(--font-body);
  font-size: 22px;
  color: #6f4d7d;
  line-height: 1.1;
}

.arcade-challenge-group-copy p {
  margin-top: 6px;
  color: #8d7559;
  font-size: 14px;
  line-height: 1.45;
}

.arcade-challenge-group-stat {
  flex-shrink: 0;
  min-width: 84px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.82);
  color: var(--terracotta);
  font-family: "Baloo 2", var(--font-body);
  font-size: 18px;
  text-align: center;
}

.time-challenge-source-controls {
  display: grid;
  gap: 12px;
}

.time-challenge-field {
  display: grid;
  gap: 6px;
  color: #8d7559;
  font-size: 14px;
  font-weight: 700;
}

.time-challenge-field select {
  width: 100%;
  border: 1px solid rgba(238, 222, 198, 0.9);
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  color: #6f4d7d;
  font: inherit;
  padding: 12px 14px;
}

.time-challenge-grid-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.time-challenge-grid-btn {
  border: 1px solid rgba(238, 222, 198, 0.9);
  border-radius: 18px;
  background: rgba(255,255,255,0.88);
  color: #7b6449;
  font-family: "Baloo 2", var(--font-body);
  font-size: 18px;
  font-weight: 700;
  padding: 12px 10px;
}

.time-challenge-grid-btn.active {
  background: linear-gradient(180deg, rgba(255, 238, 214, 0.98), rgba(255, 250, 241, 0.96));
  border-color: rgba(201, 168, 76, 0.9);
  color: var(--terracotta);
  box-shadow: 0 8px 20px rgba(193, 122, 90, 0.12);
}

.time-challenge-targets {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.time-challenge-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(238, 222, 198, 0.9);
}

.time-challenge-target-tier {
  font-family: "Baloo 2", var(--font-body);
  font-size: 18px;
  color: #6f4d7d;
}

.time-challenge-target-time {
  color: var(--terracotta);
  font-size: 15px;
  font-weight: 700;
}

.unlock-journey-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(120, 82, 50, 0.26);
  border-radius: 8px;
  background: linear-gradient(135deg, #7a9e7e, #c9a84c);
  background-repeat: no-repeat;
  color: #fff9ec;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(74, 47, 26, 0.16);
}

.unlock-journey-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(64, 45, 30, 0.14);
}

.unlock-journey-tile span {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 4px;
}

.unlock-journey-tile.is-revealed {
  cursor: default;
  color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.unlock-journey-tile.is-revealed::before {
  background: transparent;
}

.unlock-journey-tile:disabled {
  cursor: default;
}

#btn-start-unlock-special {
  align-self: center;
  margin-top: 18px;
}

.sticker-album-toc-wrap {
  margin-bottom: 22px;
}

.sticker-album-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  color: #6d4a37;
}

.sticker-album-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sticker-album-toc-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 160px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.96);
  border: 1px solid rgba(227, 207, 179, 0.9);
  color: #6d4a37;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(193, 122, 90, 0.08);
}

.sticker-album-toc-title {
  font-size: 13px;
  font-weight: 700;
}

.sticker-album-toc-count {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.16);
  color: #8d7559;
  font-size: 12px;
  font-weight: 700;
}

.sticker-album-groups {
  display: grid;
  gap: 18px;
}

.sticker-album-group {
  scroll-margin-top: 88px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(238, 222, 198, 0.9);
}

.sticker-album-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sticker-album-group-copy h3 {
  margin: 0;
  color: #6d4a37;
}

.sticker-album-group-copy p {
  margin: 6px 0 0;
  color: #8d7559;
  font-size: 14px;
  line-height: 1.45;
}

.sticker-album-group-stat {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(111, 77, 125, 0.1);
  color: #6f4d7d;
  font-size: 13px;
  font-weight: 700;
}

.sticker-album-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sticker-album-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(238, 222, 198, 0.9);
}

.sticker-album-card.is-collected {
  box-shadow: 0 10px 22px rgba(193, 122, 90, 0.12);
}

.sticker-album-card.is-locked {
  opacity: 0.72;
}

.sticker-album-frame {
  min-height: 132px;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,247,235,0.95), rgba(249,239,226,0.95));
}

.sticker-album-image {
  width: 100%;
  max-width: 180px;
  max-height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.sticker-album-card.is-locked .sticker-album-image {
  filter: grayscale(1);
  opacity: 0.38;
}

.sticker-album-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  min-height: 112px;
  padding: 14px;
  border: 2px dashed rgba(193, 122, 90, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.sticker-album-placeholder-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.18);
  color: #b07a3e;
  font-family: "Baloo 2", var(--font-body);
  font-size: 28px;
  line-height: 1;
}

.sticker-album-placeholder-text {
  color: #8d7559;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sticker-album-copy {
  margin-top: 12px;
}

.sticker-progress {
  margin-top: 10px;
}

.sticker-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(214, 194, 168, 0.45);
  overflow: hidden;
}

.sticker-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c17a5a, #c9a84c);
  transition: width 0.3s ease;
}

.sticker-progress-text {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #8d7559;
  letter-spacing: 0.03em;
}

.sticker-album-status {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(111, 77, 125, 0.1);
  color: #6f4d7d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 480px) {
  .sticker-album-group-head {
    flex-direction: column;
    align-items: stretch;
  }

  .sticker-album-toc-link {
    width: 100%;
  }

  .sticker-album-grid {
    grid-template-columns: 1fr;
  }

  .arcade-card {
    padding: 18px;
  }

  .arcade-reward-thumb,
  .arcade-reward-fallback {
    width: 64px;
    height: 64px;
  }
}

.record-item {
  background: var(--white);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px var(--shadow);
  cursor: pointer;
  transition: var(--transition);
}

.record-item:hover,
.record-item:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px var(--shadow-deep);
}

.record-img {
  width: 56px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.record-info {
  flex: 1;
  min-width: 0;
}

.record-name {
  font-family: "Baloo 2", var(--font-body);
  font-size: 18px;
  line-height: 1.1;
  color: #6f4d7d;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.record-detail {
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.35;
  color: #8d7559;
}

.record-time {
  font-family: "Baloo 2", var(--font-body);
  font-size: 22px;
  color: var(--terracotta);
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.record-time.is-dnf {
  color: #c56f57;
}

.records-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
}

.record-detail-view {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.record-detail-img {
  width: 100%;
  max-height: 46vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--cream-dark);
  box-shadow: 0 10px 28px var(--shadow-deep);
}

.record-detail-meta {
  text-align: center;
}

.record-detail-time {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--terracotta);
  font-weight: 600;
}

.record-detail-text {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.record-replay-controls {
  padding: 0;
}

.record-replay-controls .btn-primary {
  margin-top: 14px;
}

#screen-settings {
  position: absolute;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 234, 181, 0.56), transparent 24%),
    linear-gradient(180deg, #fdf6ea 0%, #f8efe2 100%);
  overflow: hidden;
}

#screen-settings::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(120deg, rgba(221, 205, 186, 0.16) 1px, transparent 1px),
    linear-gradient(60deg, rgba(221, 205, 186, 0.12) 1px, transparent 1px);
  background-size: 108px 108px;
  background-position: 0 18px, 54px 72px;
}

.settings-list {
  position: relative;
  flex: 1;
  min-height: 0;
  z-index: 1;
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 12px clamp(18px, 4vw, 42px) 42px;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
}

#screen-settings .subpage-header-art {
  width: clamp(72px, 10vw, 104px);
}

#screen-settings .subpage-header-image {
  width: 100%;
  height: auto;
  margin-left: auto;
}

#screen-settings .subpage-header {
  gap: 6px;
}

.settings-action-stack {
  display: grid;
  gap: 10px;
}

.settings-section {
  margin-bottom: 18px;
  padding: 26px 28px;
  border-radius: 28px;
  background: rgba(255, 251, 244, 0.9);
  box-shadow:
    0 16px 30px rgba(202, 172, 135, 0.15),
    inset 0 0 0 2px rgba(255,255,255,0.6);
}

.settings-section h3 {
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(28px, 3.6vw, 36px);
  font-weight: 700;
  color: #6f4d7d;
  margin-bottom: 18px;
}

.app-version-settings {
  font-family: "Baloo 2", var(--font-body);
  font-size: 17px;
  letter-spacing: 0.04em;
  color: #ab9b92;
  text-transform: uppercase;
}

.settings-copy {
  margin: -6px 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: #8b7355;
}

.preset-editor-list {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.category-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 16px 18px;
  border: 1px solid rgba(242, 225, 201, 0.92);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 8px 18px rgba(181, 152, 120, 0.08);
}

.category-toggle-item.is-disabled {
  opacity: 0.7;
}

.category-toggle-item.is-locked {
  opacity: 0.88;
}

.category-toggle-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.category-toggle-name {
  font-family: "Baloo 2", var(--font-body);
  font-size: 20px;
  font-weight: 700;
  color: #704e7f;
}

.category-toggle-count {
  font-size: 13px;
  color: #a0847d;
}

.category-toggle-item input {
  width: 26px;
  height: 26px;
  accent-color: #d28d59;
  flex: 0 0 auto;
}

.preset-editor-item {
  display: grid;
  grid-template-columns: 68px 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(242, 225, 201, 0.92);
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow: 0 8px 18px rgba(181, 152, 120, 0.08);
}

.preset-editor-label {
  font-family: "Baloo 2", var(--font-body);
  font-size: 18px;
  font-weight: 700;
}

.preset-editor-item:nth-child(1) .preset-editor-label { color: #ff7da2; }
.preset-editor-item:nth-child(2) .preset-editor-label { color: #6cc7f3; }
.preset-editor-item:nth-child(3) .preset-editor-label { color: #9ec757; }
.preset-editor-item:nth-child(4) .preset-editor-label { color: #c9a1ff; }
.preset-editor-item:nth-child(5) .preset-editor-label { color: #ffbf4c; }

.preset-editor-item input {
  height: 58px;
  border: 1px solid rgba(237, 222, 202, 0.92);
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.96);
  font-family: "Baloo 2", var(--font-body);
  font-size: 20px;
  color: #704e7f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.segment-btn {
  min-height: 86px;
  padding: 18px 14px;
  border: 1px solid rgba(239, 223, 201, 0.9);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.96);
  color: #714f7f;
  font: inherit;
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(181, 152, 120, 0.08);
}

.segment-btn.active {
  border-color: rgba(255, 206, 101, 0.92);
  background: linear-gradient(180deg, rgba(255, 232, 146, 0.92), rgba(255, 218, 103, 0.96));
  color: #694312;
}

.segment-btn[data-lang="en"]::before,
.segment-btn[data-lang="de"]::before {
  margin-right: 12px;
}

.segment-btn[data-lang="en"]::before {
  content: "🌐";
}

.segment-btn[data-lang="de"]::before {
  content: "🇩🇪";
}

.toggle-row {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(242, 225, 201, 0.92);
  border-radius: 26px;
  padding: 22px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: "Baloo 2", var(--font-body);
  font-size: clamp(24px, 3vw, 32px);
  color: #6f4d7d;
  box-shadow: 0 10px 20px rgba(181, 152, 120, 0.08);
}

.toggle-row input {
  width: 96px;
  height: 52px;
  accent-color: #b688ef;
}

.settings-note {
  margin-bottom: 16px;
  color: #8b7355;
  font-size: 16px;
  line-height: 1.5;
}

.arcade-subsettings {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.arcade-subsettings.is-disabled {
  opacity: 0.58;
}

.arcade-subsetting {
  padding: 18px 20px;
  font-size: clamp(20px, 2.5vw, 24px);
}

.danger-btn {
  color: #a0517a;
  border-color: rgba(255, 195, 215, 0.75);
  background: linear-gradient(180deg, rgba(255, 240, 246, 0.94), rgba(255, 228, 238, 0.94));
}

#screen-settings .grid-selector {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

#screen-settings .grid-btn {
  min-height: 74px;
  border: 1px solid rgba(239, 223, 201, 0.9);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.96);
  color: #704e7f;
  font-family: "Baloo 2", var(--font-body);
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(181, 152, 120, 0.08);
}

#screen-settings .grid-btn.active {
  border-color: rgba(255, 206, 101, 0.92);
  background: linear-gradient(180deg, rgba(255, 232, 146, 0.92), rgba(255, 218, 103, 0.96));
  color: #694312;
}

#screen-settings .custom-grid-row {
  margin-top: 26px;
  padding-top: 10px;
  font-family: "Baloo 2", var(--font-body);
  font-size: 22px;
  color: #704e7f;
}

#screen-settings .preview-duration-row {
  margin-top: 14px;
  padding-top: 0;
  font-size: 18px;
}

#screen-settings .preview-duration-row.is-disabled {
  opacity: 0.55;
}

#screen-settings .custom-grid-inputs {
  gap: 20px;
}

#screen-settings .custom-grid-inputs input {
  width: 118px;
  height: 64px;
  border: 1px solid rgba(239, 223, 201, 0.9);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.96);
  font-family: "Baloo 2", var(--font-body);
  font-size: 22px;
  color: #704e7f;
  box-shadow: 0 8px 18px rgba(181, 152, 120, 0.08);
}

#screen-settings #setting-start-preview-seconds {
  width: 92px;
}

#screen-settings #btn-save-presets,
#screen-settings #btn-open-admin,
#screen-settings #btn-open-support {
  min-height: 70px;
  border-radius: 22px;
  font-family: "Baloo 2", var(--font-body);
  font-size: 20px;
  font-weight: 700;
}

#screen-settings #btn-save-presets {
  background: linear-gradient(180deg, rgba(225, 210, 248, 0.96), rgba(212, 190, 244, 0.96));
  border-color: rgba(201, 175, 237, 0.92);
  color: #7f5eaf;
}

.admin-view,
.support-view {
  padding: 18px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-toolbar {
  display: flex;
}

.admin-card {
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(139, 99, 71, 0.12);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 6px 18px rgba(74, 47, 26, 0.08);
}

.admin-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--warm-brown);
  margin-bottom: 12px;
}

.admin-filter-input {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-main);
  font: inherit;
}

.admin-filter-input:focus {
  outline: none;
  border-color: var(--terracotta);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.admin-stat {
  background: var(--white);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-md);
  padding: 12px;
}

.admin-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-stat-value {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--terracotta);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-list-compact .admin-list-item {
  padding: 12px 14px;
}

.admin-list-item {
  background: var(--white);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.admin-list-item.is-clickable {
  cursor: pointer;
  transition: var(--transition);
}

.admin-list-item.is-clickable:hover,
.admin-list-item.is-clickable:active,
.admin-list-item.is-active {
  border-color: var(--terracotta);
  box-shadow: 0 8px 20px rgba(74, 47, 26, 0.12);
}

.admin-list-item-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--deep-brown);
}

.admin-list-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}

.admin-list-empty {
  padding: 20px 14px;
  border: 2px dashed var(--cream-dark);
  border-radius: var(--radius-md);
  color: var(--text-light);
  text-align: center;
  font-style: italic;
}

.admin-report-detail {
  min-height: 140px;
}

.admin-detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-detail-card {
  background: var(--white);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.admin-detail-card-wide {
  grid-column: 1 / -1;
}

.admin-detail-label {
  display: block;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-detail-value {
  display: block;
  margin-top: 6px;
  color: var(--deep-brown);
  line-height: 1.5;
  word-break: break-word;
}

.admin-detail-pre {
  margin-top: 6px;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-main);
}

.support-copy {
  margin-bottom: 12px;
  color: var(--text-soft);
  line-height: 1.55;
}

.support-preview {
  width: 100%;
  min-height: 360px;
  padding: 14px;
  resize: vertical;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-md);
  background: #fffefb;
  color: var(--text-main);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.support-preview:focus {
  outline: none;
  border-color: var(--terracotta);
}

.difficulty-rating {
  margin: 4px 0 10px;
}

.difficulty-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.difficulty-label,
.difficulty-note {
  font-size: 12px;
  color: var(--text-soft);
}

.difficulty-note {
  margin-top: 6px;
}

.community-rating {
  margin-top: 8px;
  font-size: 12px;
  color: var(--warm-brown);
}

.star-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.star-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(139, 99, 71, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.82);
  color: rgba(139, 115, 85, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.star-btn:hover {
  transform: translateY(-1px) scale(1.04);
  border-color: rgba(201, 168, 76, 0.55);
  background: rgba(255, 248, 231, 0.96);
  color: rgba(201, 168, 76, 0.85);
}

.star-btn:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.22);
}

.star-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--deep-brown);
  box-shadow: 0 6px 12px rgba(201, 168, 76, 0.22);
}

.star-btn.active:hover {
  transform: translateY(-1px) scale(1.05);
  background: var(--gold-light);
  border-color: var(--gold-light);
}

/* =============================================
   WIN OVERLAY
   ============================================= */

.win-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(10px, env(safe-area-inset-top)) clamp(14px, 4vw, 34px) 10px;
  transition: opacity 0.4s ease;
  z-index: 20;
}

.win-overlay.hidden {
  opacity: 0;
  display: none;
}

.win-card {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: 10px 12px 12px;
  text-align: center;
  max-width: 760px;
  width: 100%;
  box-shadow: 0 14px 40px rgba(74, 47, 26, 0.28);
  transform: translateY(-12px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.win-overlay:not(.hidden) .win-card {
  transform: translateY(0) scale(1);
}

.win-emoji {
  display: none;
}

@keyframes bounce-win {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.win-summary {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--deep-brown);
}

.win-summary-label {
  font-family: var(--font-display);
  font-size: 16px;
}

.win-time {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--terracotta);
  font-weight: 600;
  margin-bottom: 0;
}

.win-image-name {
  display: none;
}

.win-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.win-buttons .btn-primary,
.win-buttons .btn-secondary {
  flex: 1;
  width: auto;
  min-width: 0;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.win-hints {
  margin-top: -6px;
  color: #8d7559;
  font-size: 14px;
}

.win-celebration {
  margin: 8px 0 10px;
  padding: 12px 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 245, 214, 0.98), rgba(255, 236, 196, 0.96));
  box-shadow:
    0 10px 26px rgba(201, 168, 76, 0.16),
    inset 0 0 0 1px rgba(255,255,255,0.7);
}

.win-celebration-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b07f28;
}

.win-celebration-title {
  margin-top: 4px;
  font-family: "Baloo 2", var(--font-body);
  font-size: 24px;
  line-height: 1.08;
  color: #7a5431;
}

.win-celebration-text {
  margin-top: 6px;
  color: #8d7559;
  font-size: 14px;
  line-height: 1.4;
}

.win-celebration-stickers {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.win-celebration-sticker {
  width: 108px;
  max-width: 32%;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,0.86);
  box-shadow: 0 8px 18px rgba(193, 122, 90, 0.14);
}

.win-celebration-sticker img {
  width: 100%;
  height: 72px;
  object-fit: contain;
  display: block;
}

.win-celebration-sticker-label {
  margin-top: 6px;
  font-family: "Baloo 2", var(--font-body);
  font-size: 13px;
  line-height: 1.15;
  color: #6f4d7d;
}

/* =============================================
   GLOW ANIMATION on CANVAS
   ============================================= */

@keyframes canvas-glow {
  0%   { box-shadow: 0 8px 32px var(--shadow-deep); }
  45%  { box-shadow: 0 0 60px 20px rgba(201, 168, 76, 0.7), 0 0 120px 40px rgba(193, 122, 90, 0.4); }
  100% { box-shadow: 0 0 44px 12px rgba(201, 168, 76, 0.6), 0 0 90px 28px rgba(193, 122, 90, 0.28); }
}

#puzzle-canvas.glow {
  animation: canvas-glow 1.2s ease forwards;
  box-shadow: 0 0 44px 12px rgba(201, 168, 76, 0.6), 0 0 90px 28px rgba(193, 122, 90, 0.28);
}

/* =============================================
   DRAGGING TILE OVERLAY
   ============================================= */

#drag-tile {
  position: fixed;
  pointer-events: none;
  z-index: 500;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(74,47,26,0.45);
  transform: none;
  transition: box-shadow 0.1s;
  image-rendering: crisp-edges;
}

/* =============================================
   SCROLLBAR STYLING
   ============================================= */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 2px; }

/* =============================================
   UTILS
   ============================================= */

.hidden { display: none !important; }

/* =============================================
   TOAST
   ============================================= */

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--deep-brown);
  color: var(--cream);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 900;
  white-space: nowrap;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (min-width: 560px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-detail-grid {
    grid-template-columns: 1fr;
  }

  .screen-header,
  .game-header {
    padding: max(14px, env(safe-area-inset-top)) 14px 14px;
  }

  .subpage-header {
    gap: 10px;
  }

  .subpage-header h2 {
    font-size: 34px;
  }

  .subpage-header-art {
    width: 118px;
  }

  .game-grid-meta {
    gap: 3px;
    padding-top: 2px;
  }

  .game-grid-label {
    padding: 7px 10px;
    font-size: 14px;
  }

  .game-category-label {
    max-width: 180px;
    font-size: 11px;
  }

  .back-btn {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
  }

  .back-btn .icon-glyph {
    font-size: 32px;
  }

  .back-btn .icon-image {
    width: 56px;
    height: 56px;
  }

  #screen-browse .browse-options,
  #screen-browse .category-grid-large {
    padding-inline: 20px;
  }

  .game-toolbar {
    justify-content: center;
    gap: 6px;
    margin: 0 8px 10px;
    padding: 0;
    overflow: visible;
  }

  .game-toolbar-actions {
    gap: 4px;
    justify-content: center;
    flex-wrap: nowrap;
    min-width: 0;
  }

  #screen-browse .browse-options h3 {
    font-size: 24px;
  }

  #screen-browse .grid-selector {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    margin-inline: -20px;
    padding: 0 20px 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  #screen-browse .grid-selector::-webkit-scrollbar {
    display: none;
  }

  #screen-browse .grid-btn {
    flex: 0 0 112px;
    min-height: 62px;
    font-size: 23px;
    border-radius: 16px;
  }

  #screen-browse .grid-btn-icon {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
    background-size: 7px 7px, 7px 7px, 7px 7px, 7px 7px, 7px 7px, 7px 7px, 7px 7px, 7px 7px, 7px 7px;
    background-position: 0 0, 9px 0, 18px 0, 0 9px, 9px 9px, 18px 9px, 0 18px, 9px 18px, 18px 18px;
  }

  #screen-browse .custom-grid-row {
    margin-top: 20px;
    font-size: 22px;
  }

  #screen-browse .custom-grid-inputs input {
    width: 82px;
    height: 62px;
  }

  #screen-browse .category-grid-large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  #screen-browse .category-card {
    min-height: 228px;
    border-radius: 22px;
    padding: 18px 10px 14px;
  }

  #screen-browse .category-emoji-wrap {
    width: 82px;
    height: 82px;
    margin-bottom: 12px;
  }

  #screen-browse .category-emoji {
    font-size: 52px;
  }

  #screen-browse .category-name {
    min-height: 44px;
    font-size: 18px;
    overflow-wrap: anywhere;
  }

  #screen-browse .category-count {
    font-size: 16px;
  }

  #screen-browse .category-stars {
    gap: 4px;
    margin-top: 14px;
  }

  #screen-browse .category-stars .star-btn {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

}

@media (max-height: 600px) {
  .hero-mascot {
    width: 180px;
    height: 146px;
  }

  .hero-mascot::before,
  .hero-mascot::after {
    width: 58px;
    height: 58px;
  }

  .hero-letter {
    min-width: 74px;
    min-height: 76px;
  }

  .menu-action {
    min-height: 240px;
  }
}

@media (max-width: 420px) {
  .home-content {
    padding-inline: 14px;
    gap: 16px;
  }

  .game-header-leading {
    gap: 8px;
  }

  .game-grid-label {
    font-size: 13px;
  }

  .game-category-label {
    max-width: 150px;
  }

  .hero-wordmark {
    gap: 4px;
    padding: 14px;
  }

  .hero-letter {
    min-width: 58px;
    min-height: 64px;
    border-radius: 18px;
  }

  .hero-tagline::before,
  .hero-tagline::after {
    width: 14px;
    height: 14px;
    margin: 0;
  }

  .start-menu {
    gap: 14px;
  }

  .menu-action {
    min-height: 208px;
    border-radius: 28px;
    padding: 18px 14px;
  }

  .menu-action-icon-shell {
    width: 90px;
    height: 90px;
  }

  .menu-action-icon {
    width: 90px;
    height: 90px;
  }

  .menu-action-title {
    font-size: 20px;
  }

  .menu-action-subtitle {
    font-size: 12px;
  }

  .category-grid-large {
    padding: 16px;
  }

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

  .help-card {
    min-height: 0;
    padding: 18px;
  }

  .help-card-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }

  .game-info {
    min-width: 0;
    padding: 12px 16px 10px;
  }

  .game-toolbar {
    margin: 0 6px 8px;
    padding: 0;
    gap: 4px;
    overflow: visible;
  }

  .puzzle-container {
    flex: none;
    min-height: auto;
    padding: 0 0 10px;
    overflow: visible;
  }

  #puzzle-canvas {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    height: auto;
  }

  .timer {
    font-size: 24px;
  }

  .game-info {
    gap: 8px;
    min-width: 0;
    padding: 12px 14px;
  }

  .game-grid-label {
    font-size: 15px;
    padding: 8px 12px;
  }

  .game-grid-menu {
    right: 50%;
    transform: translateX(50%);
    min-width: 156px;
    padding: 10px;
  }

  .game-grid-option {
    font-size: 16px;
  }

  .game-actions {
    gap: 4px;
    flex-wrap: nowrap;
  }

  #screen-game .icon-btn,
  #screen-game .back-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  #screen-game .icon-btn .icon-image,
  #screen-game .back-btn .icon-image,
  #screen-game .game-lock-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  #screen-game .back-btn .icon-glyph,
  #screen-game .icon-btn .icon-glyph {
    font-size: 22px;
  }

  .puzzle-container {
    padding-inline: 14px;
  }

  #puzzle-canvas {
    border-width: 7px;
    border-radius: 22px;
  }

  .game-footer {
    margin-inline: 14px;
    padding: 18px 16px;
    border-radius: 24px;
  }

  .donation-view {
    padding: 10px 14px 24px;
    gap: 14px;
  }

  .donation-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .donation-card {
    border-radius: 24px;
    padding: 18px 16px;
  }

  .donation-card p,
  .donation-note {
    font-size: 15px;
  }

  .image-info {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .image-name {
    font-size: 24px;
  }

  .image-artist,
  .image-desc {
    font-size: 15px;
  }

  .settings-list {
    padding: 10px 14px 28px;
  }

  .settings-section {
    margin-bottom: 14px;
    padding: 18px 16px;
    border-radius: 22px;
  }

  .settings-section h3 {
    font-size: 22px;
    margin-bottom: 14px;
  }

  .segmented-control {
    gap: 12px;
  }

  .segment-btn {
    min-height: 70px;
    font-size: 18px;
    border-radius: 18px;
  }

  #screen-settings .grid-selector {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-inline: -2px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  #screen-settings .grid-selector::-webkit-scrollbar {
    display: none;
  }

  #screen-settings .grid-btn {
    flex: 0 0 96px;
    min-height: 60px;
    font-size: 18px;
  }

  #screen-settings .custom-grid-row {
    margin-top: 18px;
    font-size: 18px;
  }

  #screen-settings .custom-grid-inputs {
    gap: 12px;
  }

  #screen-settings .custom-grid-inputs input {
    width: 82px;
    height: 56px;
    font-size: 18px;
  }

  .preset-editor-list {
    gap: 10px;
  }

  .preset-editor-item {
    grid-template-columns: 52px 1fr auto 1fr;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
  }

  .preset-editor-label {
    font-size: 16px;
  }

  .preset-editor-item input {
    height: 48px;
    font-size: 18px;
    border-radius: 14px;
  }

  .toggle-row {
    padding: 16px 16px;
    font-size: 20px;
    border-radius: 20px;
  }

  .settings-note {
    font-size: 14px;
  }

  .arcade-subsetting {
    padding: 14px 16px;
    font-size: 18px;
  }

  .toggle-row input {
    width: 74px;
    height: 44px;
  }

  #screen-settings #btn-save-presets,
  #screen-settings #btn-open-admin,
  #screen-settings #btn-open-support,
  #screen-settings #btn-clear-data {
    min-height: 60px;
    font-size: 18px;
    border-radius: 18px;
  }
}

@media (min-width: 1100px) and (min-height: 760px) and (hover: hover) and (pointer: fine) {
  #screen-game {
    width: min(100vw - 56px, 1320px);
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) 288px;
    grid-template-rows: auto auto auto 1fr;
    gap: 14px;
    padding: 0 18px 18px;
    overflow: hidden;
  }

  #screen-game .game-header,
  #screen-game .game-header-top,
  #screen-game .game-header-leading {
    display: contents;
  }

  #screen-game .subpage-header-art {
    display: none;
  }

  #screen-game #btn-back-game {
    grid-column: 1;
    grid-row: 1 / span 4;
    align-self: start;
    justify-self: center;
    position: sticky;
    top: max(18px, env(safe-area-inset-top));
    width: 72px;
    height: 72px;
    min-width: 72px;
    min-height: 72px;
    border-radius: 24px;
    background: rgba(255, 251, 244, 0.9);
    box-shadow:
      0 16px 32px rgba(202, 172, 135, 0.16),
      inset 0 0 0 2px rgba(255,255,255,0.6);
  }

  #screen-game .game-grid-meta {
    grid-column: 3;
    grid-row: 1;
    padding: 18px 18px 14px;
    border-radius: 28px;
    background: rgba(255, 251, 244, 0.9);
    box-shadow:
      0 18px 34px rgba(202, 172, 135, 0.16),
      inset 0 0 0 2px rgba(255,255,255,0.6);
    gap: 8px;
  }

  #screen-game .game-grid-switcher,
  #screen-game .game-grid-label {
    width: 100%;
  }

  #screen-game .game-grid-label {
    justify-content: center;
    min-height: 52px;
    border-radius: 18px;
  }

  #screen-game .game-category-label {
    max-width: none;
    padding-left: 0;
    font-size: 13px;
    white-space: normal;
    text-align: center;
  }

  #screen-game .game-info {
    grid-column: 3;
    grid-row: 2;
    align-self: flex-start;
    margin-left: 0;
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 18px 16px;
    border-radius: 28px;
  }

  #screen-game .game-toolbar {
    grid-column: 3;
    grid-row: 3;
    margin: 0;
    padding: 18px 16px;
    border-radius: 30px;
    background: rgba(255, 251, 244, 0.9);
    box-shadow:
      0 18px 34px rgba(202, 172, 135, 0.16),
      inset 0 0 0 2px rgba(255,255,255,0.6);
    align-self: stretch;
    justify-content: flex-start;
    align-items: stretch;
  }

  #screen-game .game-toolbar-actions,
  #screen-game .game-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
  }

  #screen-game .icon-btn,
  #screen-game .game-lock-btn {
    width: 100%;
    min-width: 0;
    height: 68px;
    min-height: 68px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow:
      0 10px 22px rgba(186, 156, 120, 0.14),
      inset 0 0 0 1px rgba(255,255,255,0.8);
  }

  #screen-game .icon-btn .icon-image,
  #screen-game .game-lock-btn .icon-image {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  #screen-game .icon-btn .icon-glyph {
    font-size: 28px;
  }

  #screen-game .puzzle-container {
    grid-column: 2;
    grid-row: 1 / span 4;
    min-height: 0;
    padding: 0 10px 0 6px;
  }

  #screen-game #puzzle-canvas {
    max-width: 100%;
    max-height: 100%;
    border-width: 12px;
    border-radius: 30px;
  }

  #screen-game .game-footer {
    grid-column: 3;
    grid-row: 4;
    margin: 0;
    padding: 20px 18px;
    align-self: stretch;
    overflow: auto;
  }

  #screen-game .image-name {
    font-size: clamp(24px, 2vw, 30px);
  }

  #screen-game .image-artist {
    font-size: 16px;
  }

  #screen-game .image-desc {
    font-size: 15px;
    max-width: none;
  }

  #screen-game .game-support {
    margin-top: 14px;
  }
}
