:root {
  --bg: #0f1220;
  --panel: #181c2f;
  --text: #eef0fb;
  --muted: #9aa0c0;
  --accent: #6c5ce7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.site-header { padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.logo { font-weight: 700; font-size: 1.2rem; }
h1 { font-size: 2rem; margin: 32px 0 8px; }
.lead { color: var(--muted); margin-bottom: 24px; }
.game-frame {
  background: var(--panel);
  border-radius: 12px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 32px;
  padding: 20px;
  gap: 14px;
}
.game-placeholder { text-align: center; color: var(--muted); }
.placeholder-note { font-size: 0.85rem; }

.meow-toolbar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: center;
}
.meow-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}
.meow-field select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.9rem;
}
.meow-stat { font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.meow-buttons { display: flex; gap: 8px; }
.meow-buttons button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}
.meow-buttons button:hover { opacity: 0.9; }

.meow-board {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  grid-template-rows: repeat(var(--n), minmax(0, 1fr));
  gap: 3px;
  width: min(420px, 90vw);
  aspect-ratio: 1 / 1;
}
.meow-cell {
  border: none;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  filter: brightness(0.55);
  transition: filter 0.1s, transform 0.1s;
  overflow: hidden;
  position: relative;
}
.meow-cell:hover { filter: brightness(0.7); }
.meow-cell.has-cat, .meow-cell.has-x { filter: brightness(0.85); }
.meow-cell.locked { cursor: default; box-shadow: inset 0 0 0 3px rgba(0,0,0,0.45); }
.meow-cell.locked:hover { filter: brightness(0.55); }
.meow-cell.conflict {
  animation: meow-shake 0.4s;
  filter: brightness(1) !important;
  box-shadow: 0 0 0 2px #ff4d4d inset;
}
@keyframes meow-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.meow-message {
  min-height: 1.4em;
  font-weight: 600;
  text-align: center;
}
.meow-rules {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  max-width: 480px;
}
.content-block { margin: 28px 0; }
.content-block h2 { font-size: 1.3rem; }
details {
  background: var(--panel);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
summary { cursor: pointer; font-weight: 600; }
.site-footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 0.85rem;
}
