:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #111827;
  --sub: #4b5563;
  --primary: #0f766e;
  --danger: #b91c1c;
  --ok: #166534;
  --ng: #9f1239;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #e2f3ff, var(--bg));
}
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 16px;
}
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.hidden { display: none; }
.row { display: flex; align-items: center; gap: 8px; }
.space { justify-content: space-between; }
.sub { color: var(--sub); margin: 8px 0; }
input, button {
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
}
label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
}
input {
  display: block;
  width: 100%;
}
button { cursor: pointer; background: #fff; }
button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0;
}
.option {
  border: 1px solid #cbd5e1;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
}
.option.selected { border: 2px solid var(--primary); background: #e6fffa; }
.option.correct { border: 2px solid var(--ok); background: #dcfce7; }
.option.wrong { border: 2px solid var(--ng); background: #ffe4e6; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.icon-btn {
  width: 64px;
  height: 64px;
  padding: 0;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.selected {
  border: 3px solid var(--primary);
  background: #e6fffa;
  transform: scale(1.04);
}
.badge {
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dcfce7;
}
.feedback { font-weight: 700; min-height: 24px; }
.big { font-size: 28px; font-weight: 700; }
.progress-wrap {
  width: 100%;
  height: 18px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #ef4444);
  transition: width 0.3s ease;
}
.rain {
  min-height: 120px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rain .chip {
  font-size: 24px;
  animation: popIn 0.6s ease;
}
.physics-stage {
  width: 100%;
  height: 420px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef7ff 100%);
  overflow: hidden;
}
.physics-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}
@keyframes popIn {
  from { transform: translateY(-22px) scale(0.7); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.grid2 { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.ranking table { width: 100%; border-collapse: collapse; }
.ranking th, .ranking td { padding: 8px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.entry-guide {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  text-align: center;
}
.entry-guide img {
  width: 220px;
  max-width: 100%;
  height: auto;
  border: 8px solid #fff;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.join-url {
  font-weight: 700;
  word-break: break-all;
}
@media (max-width: 768px) {
  .grid2 { grid-template-columns: 1fr; }
  .big { font-size: 24px; }
}
