:root {
  --bg-dark: #121019;
  --bg-gradient: radial-gradient(circle at 50% 10%, #291b2e 0%, #110d18 100%);
  --paper-trans: rgba(255, 255, 255, 0.07);
  --border-trans: rgba(255, 255, 255, 0.14);
  --text-main: #fbf9f5;
  --text-muted: #a69bb0;

  --flame-color: #ff5757;
  --flame-glow: rgba(255, 87, 87, 0.45);
  --sun-color: #ffca3a;
  --sun-glow: rgba(255, 202, 58, 0.45);
  --moon-color: #6a95f8;
  --moon-glow: rgba(106, 149, 248, 0.45);
  --spark-color: #49d479;
  --spark-glow: rgba(73, 212, 121, 0.45);
}

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

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  min-height: 100vh;
  padding: 16px 12px 48px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

.subtitle-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: #dab6f5;
  background: rgba(184, 127, 243, 0.12);
  border: 1px solid rgba(184, 127, 243, 0.25);
  padding: 4px 14px;
  border-radius: 99px;
  margin-bottom: 8px;
}

h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 6px;
}

.meta-status {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

/* 4寮ゲージグリッド */
.gauges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 28px;
}

.gauge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.house-header {
  text-align: center;
  margin-bottom: 10px;
}

.house-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.house-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.house-points {
  font-size: 13px;
  font-weight: 800;
  margin-top: 2px;
  min-height: 18px;
}

/* 縦長円柱・砂時計ゲージ */
.cylinder-wrapper {
  position: relative;
  width: 100%;
  max-width: 82px;
  height: 280px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--border-trans);
  border-radius: 36px;
  overflow: hidden;
  box-shadow: inset 0 4px 15px rgba(0,0,0,0.5), 0 8px 20px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* 砂・液面 */
.sand-fill {
  width: 100%;
  height: 0%;
  transition: height 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  border-radius: 0 0 34px 34px;
}

.flame .sand-fill {
  background: linear-gradient(180deg, #ff8c8c 0%, var(--flame-color) 60%, #bd2a2a 100%);
  box-shadow: 0 0 20px var(--flame-glow);
}
.flame .house-name, .flame .house-points { color: var(--flame-color); }

.sunshine .sand-fill {
  background: linear-gradient(180deg, #ffe58f 0%, var(--sun-color) 60%, #c99314 100%);
  box-shadow: 0 0 20px var(--sun-glow);
}
.sunshine .house-name, .sunshine .house-points { color: var(--sun-color); }

.moon .sand-fill {
  background: linear-gradient(180deg, #a4c2ff 0%, var(--moon-color) 60%, #3058b4 100%);
  box-shadow: 0 0 20px var(--moon-glow);
}
.moon .house-name, .moon .house-points { color: var(--moon-color); }

.spark .sand-fill {
  background: linear-gradient(180deg, #8effaf 0%, var(--spark-color) 60%, #208e45 100%);
  box-shadow: 0 0 20px var(--spark-glow);
}
.spark .house-name, .spark .house-points { color: var(--spark-color); }

/* 砂の上面の光彩 */
.sand-top-rim {
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  filter: blur(1px);
}

.pct-badge {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

/* 参加者カードセクション */
.participants-section {
  background: var(--paper-trans);
  border: 1px solid var(--border-trans);
  border-radius: 24px;
  padding: 20px 16px;
  backdrop-filter: blur(12px);
}

.participants-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
  text-align: center;
}

.house-members-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.house-box {
  border: 1px solid var(--border-trans);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.2);
}

.house-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chip-pts {
  color: #fce8a6;
  font-weight: 700;
}

.bottom-nav {
  text-align: center;
  margin-top: 24px;
}

.back-link {
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
}
.back-link:hover { color: var(--text-main); text-decoration: underline; }
