/* ============================================================
   Cut the Shape - game-specific styles
   ============================================================ */

#level-select-view {
  width: 100%;
}

.ch-intro {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  margin: 0 0 22px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 10px;
  max-width: 620px;
  margin: 0 auto;
}

.level-btn {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: 0 4px 0 rgba(34, 49, 74, 0.12);
  transition: transform 0.1s ease;
}
.level-btn:hover:not(:disabled) { transform: translateY(-2px); }
.level-btn.completed {
  background: var(--simon-green);
  color: #fff;
}
.level-btn .best {
  font-family: var(--font-body);
  font-size: 0.55rem;
  font-weight: 800;
  opacity: 0.9;
}
.level-btn .diff-dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.diff-easy { background: var(--simon-green); }
.diff-medium { background: var(--yellow-deep); }
.diff-hard { background: var(--pink-deep); }
.diff-expert { background: var(--purple-deep); }

.ch-legend {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.ch-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ch-legend .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.ch-play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.ch-level-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.difficulty-chip {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.ch-mode-toggle {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 4px;
}
.ch-mode-toggle button {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(34, 49, 74, 0.12);
}
.ch-mode-toggle button.active {
  background: var(--purple-deep);
  color: #fff;
}

.ch-board-wrap {
  width: min(540px, 92vw);
  max-width: 100%;
  aspect-ratio: 1;
  margin: 4px auto 0;
}
.ch-board {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 3px solid var(--ink);
  background: var(--bg-soft);
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: crosshair;
}
.instructions.ch {
  margin-top: 4px;
}

#game-stage:fullscreen,
#game-stage.is-ios-fullscreen {
  border-radius: 0;
  border: none;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  height: calc(var(--obg-vh, 1vh) * 100);
  justify-content: flex-start;
  background: var(--bg-soft);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#game-stage:fullscreen .ch-board-wrap,
#game-stage.is-ios-fullscreen .ch-board-wrap {
  width: min(100%, 78vh);
  width: min(100%, 78dvh);
}

@media (max-width: 480px) {
  .level-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
  .level-btn { font-size: 0.9rem; }
}
