:root {
  --bg: #fce4ec;
  --panel: #fce4ec;
  --border: #f48fb1;
  --accent: #e91e8c;
  --text: #2d1b2e;
  --muted: #9c6b8a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}

.board {
  position: relative;
  width: min(94vw, calc(82vh * 3 / 4));
  aspect-ratio: 3 / 4;
  max-height: 82vh;
  border: 3px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: #fff8f9;
  box-shadow: 0 8px 30px rgba(233, 30, 140, 0.2);
}

.wrap:fullscreen,
.wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  padding: 0;
  gap: 0;
}
.wrap:fullscreen .board,
.wrap:-webkit-full-screen .board {
  width: min(100vw, calc(100vh * 3 / 4));
  max-height: 100vh;
  border-radius: 0;
  border: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  pointer-events: none;
  z-index: 3;
  background: rgba(255, 248, 249, 0.85);
  border-bottom: 1px solid rgba(244, 143, 177, 0.3);
}

.bar h1 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-right { display: flex; align-items: center; gap: 6px; }

.icon {
  pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: 14px; line-height: 1;
  padding: 5px 7px;
  cursor: pointer;
  text-decoration: none;
}
.icon:hover { border-color: var(--accent); }

.foot { font-size: 11px; color: var(--muted); }
