:root {
  --bg: #0a0a0f;
  --surface: #14141f;
  --border: #2a2a3a;
  --pink: #ff2d78;
  --cyan: #00e5ff;
  --gold: #ffd700;
  --text: #e8e8f0;
  --text-dim: #8888aa;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 12px;
}

.title {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
}

.title-slash {
  background: linear-gradient(135deg, var(--gold), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Score Display */
.score-display {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
  padding: 10px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.score-cpu, .score-player {
  text-align: center;
}

.score-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2px;
}

.score-cpu .score-label {
  color: var(--cyan);
}

.score-player .score-label {
  color: var(--pink);
}

.score-value {
  font-size: 2rem;
  font-weight: 900;
  display: block;
  line-height: 1;
}

.score-cpu .score-value {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.score-player .score-value {
  color: var(--pink);
  text-shadow: 0 0 12px rgba(255, 45, 120, 0.5);
}

.score-divider {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dim);
}

/* Canvas */
.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin-bottom: 16px;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow:
    0 0 15px rgba(255, 45, 120, 0.15),
    0 0 30px rgba(0, 229, 255, 0.1),
    inset 0 0 15px rgba(0, 0, 0, 0.3);
  background: var(--bg);
  cursor: none;
  touch-action: none;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.85);
  border-radius: 8px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  text-align: center;
}

.overlay-title {
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  line-height: 1.3;
}

.overlay-sub {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Difficulty Buttons */
.difficulty-section {
  margin-bottom: 16px;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.difficulty-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.difficulty-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.diff-btn {
  flex: 1;
  max-width: 120px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.3;
}

.diff-btn .diff-jp {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: 400;
}

.diff-btn:hover {
  border-color: var(--pink);
  background: rgba(255, 45, 120, 0.1);
}

.diff-btn.active {
  border-color: var(--pink);
  background: rgba(255, 45, 120, 0.15);
  box-shadow: 0 0 12px rgba(255, 45, 120, 0.2);
}

/* Patreon CTA */
.patreon-cta {
  margin-bottom: 16px;
  width: 100%;
  max-width: 400px;
}

.patreon-link {
  display: block;
  text-align: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--pink), #ff6b35);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 45, 120, 0.3);
}

.patreon-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 45, 120, 0.4);
}

.patreon-emoji {
  font-style: normal;
}

/* How to Play */
.how-to-play {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

.how-to-play summary {
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  font-size: 0.9rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.how-to-play summary::after {
  content: '▼';
  font-size: 0.65rem;
  color: var(--text-dim);
  transition: transform 0.3s;
}

.how-to-play[open] summary::after {
  transform: rotate(180deg);
}

.how-to-content {
  padding: 0 16px 16px;
}

.how-to-section {
  margin-bottom: 12px;
}

.how-to-section:last-child {
  margin-bottom: 0;
}

.how-to-section h3 {
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--gold);
}

.how-to-section ul {
  list-style: none;
  padding: 0;
}

.how-to-section li {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 3px 0;
  padding-left: 12px;
  position: relative;
}

.how-to-section li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--pink);
}

/* Footer */
.footer {
  text-align: center;
  padding: 12px 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.footer a {
  color: var(--pink);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Share button (injected by JS) */
.share-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 20px;
  background: #1da1f2;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: #0d8bd9;
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 440px) {
  .container {
    padding: 10px;
  }

  .title {
    font-size: 1.4rem;
  }

  .score-display {
    gap: 14px;
    padding: 8px 20px;
  }

  .score-value {
    font-size: 1.6rem;
  }
}
