/* Purrfect Places only. Shared styles live in ../shared/base.css. */
main { max-width: 1140px; margin: 30px auto 45px; padding: 0 32px; display: grid; grid-template-columns: 1fr 1.28fr; gap: 64px; align-items: start; }
.intro { padding-top: 24px; }
h1 { font-family: Georgia, serif; font-weight: 400; font-size: 60px; line-height: 1.08; letter-spacing: -2px; margin: 22px 0; }
h1 em { color: #bc6447; font-weight: 400; }
.intro > p { line-height: 1.8; color: var(--muted); font-size: 16px; }
.bigcat { width: 190px; height: 135px; margin: 23px 0 20px 25px; transform: rotate(-7deg); }
.bigcat svg { height: 100%; width: 100%; }
.rules { border-top: 1px solid #e3e2d7; padding-top: 18px; }
.rules h2 { font-size: 15px; margin: 0 0 16px; }
.rules p { font-size: 14px; color: #697267; margin: 13px 0; }
.rules b { font-size: 10px; letter-spacing: 1px; color: #b58c75; margin-right: 12px; }
.cozy { font-size: 12px; color: #91958b; margin-top: 30px; }

/* ---------- game card ---------- */
.game { background: var(--card); border: 1px solid var(--line); box-shadow: 0 12px 45px #3d443508; border-radius: 24px; padding: 26px; }
.game-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.game-top h2 { font-family: Georgia, serif; font-weight: 400; font-size: 28px; margin: 6px 0 18px; }
.puzzle-label { border: 0; background: transparent; padding: 4px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-align: left; }
.paws { font-size: 11px; letter-spacing: 2px; color: var(--accent); }
.paws .off { color: #d9d6cc; }
.pick-hint { font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.progress { text-align: right; flex-shrink: 0; }
.progress strong { display: block; font-size: 21px; }
.progress span { font-size: 11px; color: var(--soft); }

.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: #f2f2eb; padding: 4px; border-radius: 12px; margin-bottom: 22px; }
.levels button { font-size: 11px; padding: 9px 2px; border: 0; background: transparent; border-radius: 9px; font-weight: bold; line-height: 1.2; }
.levels small { display: block; font-weight: 400; font-size: 10px; margin-top: 3px; opacity: .65; }
.levels .active { background: var(--card); box-shadow: 0 2px 6px #00000012; }
.levels .done-all::after { content: ' ★'; color: var(--accent); }

/* ---------- board ---------- */
.board-wrap { position: relative; }
#board {
  display: grid; aspect-ratio: 1; overflow: hidden;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  grid-template-rows: repeat(var(--n), minmax(0, 1fr));
  border: 3px solid var(--wall); border-radius: 14px; isolation: isolate; background: var(--wall);
}
.cell {
  position: relative; border: 0; border-radius: 0; padding: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0;
  border-right: 1px solid #505a4d24; border-bottom: 1px solid #505a4d24; background: var(--room);
}
.cell.wall-r { border-right: 3px solid var(--wall); }
.cell.wall-b { border-bottom: 3px solid var(--wall); }
.cell svg { width: 76%; height: 76%; filter: drop-shadow(0 2px 0 #fff5); }
.cell .letter { position: absolute; top: 3px; left: 5px; font-size: clamp(10px, 2.4vw, 13px); font-weight: 700; opacity: .55; }
.cell .x { font-size: clamp(18px, 5vw, 30px); opacity: .45; line-height: 1; }
.cell.blocked::after { content: ''; position: absolute; inset: 0; background: #ffffff8c; pointer-events: none; }
.cell.focus::before { content: ''; position: absolute; inset: 3px; border: 2px dashed #6b5a2f; border-radius: 4px; pointer-events: none; z-index: 1; }
.cell.hinted { box-shadow: inset 0 0 0 4px #b55535; z-index: 2; animation: pulse 1.2s ease-in-out 2; }
.cell.conflict { box-shadow: inset 0 0 0 3px var(--alert); z-index: 2; }
.cell.conflict svg { animation: wobble .4s ease 1; }
.cell.pop svg { animation: pop .25s ease-out 1; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 7px #b55535; } }
@keyframes pop { from { transform: scale(.4); } }
@keyframes wobble { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* ---------- celebration ---------- */
.celebrate {
  position: absolute; inset: 0; border-radius: 14px; background: #fffdf9eb;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px;
  animation: fade .35s ease;
}
.celebrate[hidden] { display: none; }
.celebrate h3 { font: 44px Georgia, serif; margin: 8px 0 4px; color: var(--accent); }
.celebrate p { color: var(--muted); margin: 0 0 20px; line-height: 1.5; max-width: 320px; }
.party { display: flex; gap: 6px; height: 70px; }
.party svg { width: 58px; height: 58px; animation: hop .7s ease-in-out infinite alternate; }
.party svg:nth-child(2) { animation-delay: .15s; }
.party svg:nth-child(3) { animation-delay: .3s; }
.win-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
@keyframes hop { to { transform: translateY(-14px) rotate(6deg); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- controls ---------- */
.mode { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 10px; font-size: 13px; }
.mode > span { color: var(--soft); margin-right: 8px; }
.mode button { padding: 9px 14px; font-size: 13px; border: 0; background: #f1f1e9; }
.mode button.active { background: var(--forest); color: white; }
#message { font-size: 14px; line-height: 1.55; text-align: center; min-height: 44px; margin: 12px 0; color: #586554; }
.actions { display: flex; gap: 8px; justify-content: space-between; }
.actions button { font-size: 13px; padding: 12px 10px; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.helper { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 12px; color: var(--muted); cursor: pointer; }
.helper input { width: 18px; height: 18px; accent-color: var(--forest); }
.bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 12px; color: var(--soft); font-size: 11px; }
.bottom button { border: 0; padding: 0; background: transparent; font-size: 11px; color: #818b7c; text-decoration: underline; }

.tier { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: #82897b; margin: 18px 0 8px; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tile { position: relative; padding: 0; aspect-ratio: 1; border-radius: 12px; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.tile.done { background: #e6efe0; border-color: #c4d6bb; }
.tile.done svg { position: absolute; width: 26px; height: 26px; right: -6px; top: -8px; }
.tile.started::after { content: ''; position: absolute; bottom: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tile.current { outline: 3px solid var(--forest); outline-offset: 1px; }

.won { animation: celebrate .65s ease; }
@keyframes celebrate { 50% { transform: scale(1.025); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  main { gap: 28px; grid-template-columns: .8fr 1.2fr; }
  h1 { font-size: 45px; }
  .game { padding: 20px; }
}
@media (max-width: 690px) {
  main { display: flex; flex-direction: column; padding: 0 12px; margin: 0 auto 25px; gap: 16px; max-width: 540px; }
  .intro { padding: 0 8px; width: 100%; }
  .intro .eyebrow { font-size: 9px; }
  h1 { font-size: 34px; margin: 8px 0; line-height: 1.05; letter-spacing: -1px; }
  h1 br, .intro > p br { display: none; }
  .intro > p { font-size: 14px; line-height: 1.5; margin: 6px 0; }
  .bigcat, .rules, .cozy { display: none; }
  .game { width: 100%; padding: 14px; border-radius: 20px; }
  .game-top h2 { font-size: 24px; margin-bottom: 12px; }
  .levels { margin-bottom: 14px; }
  .levels button { font-size: 10px; padding: 8px 1px; }
  .actions button { font-size: 12px; padding: 12px 8px; }
  .celebrate h3 { font-size: 34px; }
  .party svg { width: 44px; height: 44px; }
}

.win-points { font-weight: 700; color: var(--forest) !important; min-height: 1.4em; margin: -12px 0 16px !important; }

@media (prefers-reduced-motion: reduce) {
  .won, .cell.hinted, .cell.pop svg, .cell.conflict svg, .party svg, .celebrate { animation: none; }
}
