/* Hitori — Playnesta original (MIT). Grid, cells, buttons. */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  background: radial-gradient(circle at 50% 18%, #2a2440, #161222 70%);
  color: #ece9f4;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: calc(var(--pn-vh, 1vh) * 100);
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  gap: 8px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.65;
  margin-left: 6px;
  text-transform: lowercase;
}
.meta {
  display: flex;
  gap: 10px;
}
.meta span {
  font-size: 14px;
  opacity: 0.9;
}
.modes {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.boardwrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.boardbox {
  display: grid;
  gap: 2px;
  touch-action: manipulation;
}
.cell {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #342c4d;
  border: 1px solid #4d4370;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  position: relative;
}
.cell.shaded {
  background: #191322;
  border-color: #322a45;
  color: rgba(236, 233, 244, 0.28);
}
.cell.noted::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid #8f84c9;
  border-radius: 50%;
  pointer-events: none;
}
.cell.shaded.noted::after {
  display: none;
}
.cell.bad {
  background: #a03a3a;
  border-color: #e06565;
  color: #fff;
}
.msg {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  min-height: 24px;
}
.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #6f5fa8;
  background: #3b3260;
  color: #ece9f4;
  cursor: pointer;
}
.btn.primary {
  background: #6f5fa8;
  color: #fff;
  border-color: #a293d6;
}
.btn.mode.on {
  background: #6f5fa8;
  color: #fff;
  border-color: #a293d6;
}
.btn:active {
  transform: scale(0.97);
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 10, 22, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.overlay.hidden {
  display: none;
}
.panel {
  background: #251e38;
  border: 1px solid #6f5fa8;
  border-radius: 16px;
  padding: 18px;
  max-width: 420px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
}
.panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}
.panel p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
}
.panel-wide {
  max-width: 520px;
}
.rules-list {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
}
.rules-list li {
  margin-bottom: 8px;
}
@media (max-width: 430px) {
  .cell {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }
}
