:root {
  /* Tokyo Tech–inspired (see Titech Page Design reference CSS / logo.svg) */
  --bg: #0a1628;
  --surface: #0f1f35;
  --surface-inset: #0c1929;
  --border: #2d4a66;
  --text: #e8ecf4;
  --muted: #8fa3c4;
  --accent: #4a9fd9;
  --accent2: #7f96c2;
  --danger: #ff6b6b;
  --gold: #c9a227;
  --radius: 12px;
  font-family:
    "Noto Sans JP",
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 580px at 15% -8%, rgba(28, 49, 119, 0.45) 0%, transparent 58%),
    radial-gradient(900px 520px at 100% 5%, rgba(127, 150, 194, 0.18) 0%, transparent 52%),
    radial-gradient(800px 400px at 50% 100%, rgba(5, 45, 93, 0.35) 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
}

header.app-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(10, 22, 40, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.panel.inset {
  background: var(--surface-inset);
  border-color: rgba(55, 87, 125, 0.55);
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
  font-weight: 650;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #1a2f4a, #122238);
  color: var(--text);
  padding: 0.65rem 1rem;
}

button.primary {
  border-color: #0d4f78;
  background: linear-gradient(180deg, #105f90, #052d5d);
}

button.ghost {
  background: transparent;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.small {
  padding: 0.4rem 0.65rem;
  font-size: 0.88rem;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-inset);
  color: var(--text);
  font: inherit;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.award-block {
  margin-bottom: 1.5rem;
}

.award-title {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
  min-height: 180px;
  padding: 0.5rem 0 0;
}

.podium .place {
  flex: 1;
  max-width: 160px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.5rem;
  text-align: center;
  background: var(--surface-inset);
}

.podium .place .rank {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.podium .place .name {
  font-weight: 650;
  word-break: break-word;
}

.podium .place .metric {
  margin-top: 0.35rem;
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
}

.podium .first {
  order: 2;
  min-height: 160px;
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.35) inset,
    0 0 20px rgba(146, 117, 0, 0.2);
}

.podium .second {
  order: 1;
  min-height: 130px;
}

.podium .third {
  order: 3;
  min-height: 110px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.slider-row .tick {
  width: 2rem;
  text-align: center;
  color: var(--muted);
  user-select: none;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

/* Hide numeric tooltip where supported */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.thankyou {
  text-align: center;
  padding: 3rem 1rem;
}

.thankyou h2 {
  font-size: 1.6rem;
}

.presenter-list {
  display: grid;
  gap: 0.5rem;
}

.presenter-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--surface-inset);
}

.presenter-option input {
  width: auto;
}

.code-panel {
  max-width: 520px;
  margin: 0 auto;
}

.step-indicator {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.admin-wrap {
  max-width: 900px;
  margin: 0 auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.35rem;
  text-align: left;
  vertical-align: top;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}

.badge.active {
  border-color: #2d6b5c;
  color: #a8e6d8;
}

.badge.draft {
  border-color: #8a7340;
  color: #e8d4a8;
}

.badge.closed {
  border-color: #4a5568;
  color: #a0aec0;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.small {
  font-size: 0.88rem;
}

.error {
  color: #ffb4b4;
  margin-top: 0.5rem;
}

.success {
  color: #a8d4c8;
  margin-top: 0.5rem;
}
