:root {
  --bg-deep: #3659a6;
  --bg-night: #4465bb;
  --card: #7c7ce6;
  --accent: #d3fa54;
  --accent-wolf: #f98dff;
  --text: #c4f5fd;
  --muted: #a0f588;
}

body {
  font-family: "Noto Serif JP", "Noto Sans JP", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  text-align: center;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: radial-gradient(circle at 20% 20%, rgba(203, 239, 25, 0.67), transparent 35%),
              radial-gradient(circle at 80% 30%, rgba(248, 133, 169, 0.612), transparent 40%),
              linear-gradient(135deg, var(--bg-deep), var(--bg-night));
  padding: clamp(28px, 6vw, 52px) clamp(18px, 5vw, 32px) clamp(40px, 8vw, 64px);
}

h1, h2 {
  margin: 0;
  letter-spacing: 0.04em;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

h1 {
  font-size: clamp(26px, 4vw, 36px);
}

h2 {
  font-size: clamp(22px, 3.6vw, 30px);
  color: var(--accent);
}

p {
  margin: 0;
}

.admin-link {
  padding: 10px;
  color: transparent;
  text-decoration: none;
  user-select: none;
}

.buttons {
  width: min(640px, 96vw);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.buttons button {
  font-size: 17px;
  padding: 12px 18px;
  min-height: 52px;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  background: linear-gradient(145deg, var(--card), #111829);
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.buttons button:hover {
  transform: translateY(-2px);
  border-color: rgba(106, 224, 255, 0.4);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.45),
    0 0 0 6px rgba(106, 224, 255, 0.08);
}

.buttons button:active {
  transform: translateY(0);
}

.top-image {
  width: 35%;
  height: auto;
}

.topic {
  font-size: clamp(26px, 5vw, 36px);
  margin-top: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent-wolf);
  text-shadow: 0 10px 35px rgba(255, 107, 154, 0.35);
}

.topic-table-wrap {
  overflow-x: auto;
}

.topic-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
  text-align: left;
}

.topic-table th,
.topic-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topic-table th {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.topic-table td:nth-child(2) {
  color: var(--accent);
  font-weight: 700;
}

.topic-table td:nth-child(3) {
  color: var(--accent-wolf);
  font-weight: 700;
}

.topic-table td:nth-child(4) {
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.note {
  color: var(--muted);
  margin-top: 12px;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.timer-card {
  width: min(760px, 96vw);
  background: rgba(23, 62, 152, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 20px;
  backdrop-filter: blur(6px);
}

.timer-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(9, 12, 20, 0.72);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.timer-overlay.hidden {
  display: none;
}

.timer-overlay-card {
  width: min(520px, 92vw);
  padding: 26px 22px;
  border-radius: 18px;
  background: linear-gradient(160deg, #1d263b, #111829);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.timer-overlay-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.timer-overlay-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.timer-overlay-card button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 16px;
  color: var(--text);
  background: linear-gradient(145deg, #1f2a42, #121a2c);
  cursor: pointer;
}

.timer-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: 0.04em;
}

.timer-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.timer-box {
  padding: 14px;
  background: linear-gradient(145deg, rgba(21, 57, 150, 0.9), rgba(12, 18, 31, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
}

.timer-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.timer-label {
  padding-right: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.timer-display {
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 8px 30px rgba(106, 224, 255, 0.35);
}

.timer-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.timer-controls button,
.time-inputs button {
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  background: linear-gradient(145deg, #1f2a42, #121a2c);
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.timer-controls button:hover,
.time-inputs button:hover {
  transform: translateY(-1px);
  border-color: rgba(106, 224, 255, 0.5);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3), 0 0 0 5px rgba(106, 224, 255, 0.08);
}

.timer-controls button:active,
.time-inputs button:active {
  transform: translateY(0);
}

.time-inputs {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
  align-items: center;
  justify-content: start;
}

.time-inputs label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.time-inputs input {
  width: 64px;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0f1524;
  color: var(--text);
  font-size: 14px;
  text-align: center;
}

.time-inputs input:focus {
  outline: 2px solid rgba(106, 224, 255, 0.4);
  outline-offset: 1px;
}

.timer-admin-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.admin-open {
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(145deg, #24324d, #10182a);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.admin-open:hover {
  transform: translateY(-1px);
  border-color: rgba(106, 224, 255, 0.45);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25), 0 0 0 5px rgba(106, 224, 255, 0.08);
}

@media (max-width: 480px) {
  body {
    gap: 16px;
  }

  .top-image {
    width: 80%;
    height: auto;
  }

  .buttons {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
  }

  .buttons button {
    font-size: 16px;
    min-height: 48px;
    border-radius: 12px;
  }

  .timer-grid {
    grid-template-columns: 1fr;
  }

  .timer-card {
    width: auto;
  }

  .time-inputs {
    grid-template-columns: repeat(3, 1fr);
  }

  .time-inputs input {
    width: 100%;
  }

  .topic-table {
    font-size: 13px;
  }
}
