/* ============================================================
   STREET TO VISION — Survey App CSS
   ============================================================ */

:root {
  --dark:    #0d0d1a;
  --navy:    #1a1a2e;
  --purple:  #16213e;
  --accent:  #e94560;
  --gold:    #f5a623;
  --light:   #eaeaea;
  --muted:   #888;
  --card-bg: #1e1e30;
  --radius:  12px;
}

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

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: var(--dark);
  color: var(--light);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────── */
.site-header {
  background: var(--navy);
  border-bottom: 2px solid var(--accent);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-header .logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--light);
}
.site-header .logo span { color: var(--accent); }
.site-header nav { margin-left: auto; }
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  margin-left: 16px;
}
.site-header nav a:hover { color: var(--light); }

/* ── Main container ─────────────────────────────── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* ── Cards ──────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn-primary  { background: var(--accent);  color: #fff; }
.btn-outline  { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-danger   { background: #c0392b; color: #fff; }
.btn-calendar { background: #2980b9; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }

/* ── Forms ──────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
input[type="text"],
input[type="date"] {
  background: #12121f;
  border: 1.5px solid #333;
  color: var(--light);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: .9rem;
  flex: 1;
}
input[type="text"]:focus,
input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Event list ─────────────────────────────────── */
.event-list { list-style: none; }
.event-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #2a2a3d;
}
.event-list li:last-child { border-bottom: none; }
.event-date {
  font-size: .8rem;
  color: var(--muted);
  width: 110px;
  flex-shrink: 0;
}
.event-name { font-weight: 600; flex: 1; }

/* ── Performer rows ─────────────────────────────── */
.performer-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #2a2a3d;
}
.performer-row:last-child { border-bottom: none; }
.order-num {
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
}
.performer-name { font-weight: 600; font-size: 1rem; }
.qr-toggle {
  background: none;
  border: 1.5px solid #444;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: .75rem;
  cursor: pointer;
}
.tip-inline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tip-inline .tip-label {
  font-size: .72rem;
  color: #f0b030;
  font-weight: 600;
  white-space: nowrap;
}
.tip-inline form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tip-inline input[type=number] {
  width: 120px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #1a1a2e;
  color: #fff;
  font-size: .8rem;
}
.tip-inline button {
  background: #c07a00;
  color: #fff;
  font-size: .75rem;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.dup-warn {
  background: #3a2418;
  border: 1px solid #a0522d;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: .8rem;
  line-height: 1.6;
  color: #ffd0a0;
}
.tip-log {
  flex-basis: 100%;
  background: #1a1a2e;
  border: 1px solid #2a2a3e;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 4px;
}
.tip-log-total {
  font-size: .72rem;
  color: #f0b030;
  font-weight: 600;
  margin-bottom: 6px;
}
.tip-log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  font-size: .78rem;
  color: #ddd;
}
.tip-log-time {
  color: var(--muted);
  font-size: .72rem;
  min-width: 38px;
}
.tip-log-amount {
  min-width: 72px;
  font-weight: 600;
}
.tip-inline .tip-log button.tip-undo {
  background: transparent;
  color: #e06b6b;
  border: 1px solid #e06b6b;
  font-size: .7rem;
  padding: 2px 8px;
}
.qr-panel {
  display: none;
  grid-column: 1 / -1;
  background: #111;
  border-radius: 10px;
  padding: 16px;
  margin-top: 4px;
  text-align: center;
}
.qr-panel.open { display: block; }
.qr-panel img { width: 160px; height: 160px; border-radius: 6px; }
.qr-url {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 8px;
  word-break: break-all;
}

/* ── Results table ──────────────────────────────── */
.results-table {
  width: 100%;
  border-collapse: collapse;
}
.results-table th {
  text-align: left;
  font-size: .78rem;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid #2a2a3d;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.results-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #1e1e30;
}
.results-table tr:last-child td { border-bottom: none; }
.rank-badge {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2a2a3d;
  text-align: center;
  line-height: 28px;
  font-size: .82rem;
  font-weight: 700;
}
.rank-badge.top1 { background: var(--gold); color: #000; }
.rank-badge.top2 { background: #aaa;        color: #000; }
.rank-badge.top3 { background: #cd7f32;     color: #fff; }
.rank-point {
  font-weight: 700;
  color: var(--accent);
  font-size: .95rem;
}
.star-display { color: var(--gold); letter-spacing: 2px; }
.vote-count { font-size: .8rem; color: var(--muted); }

/* ── Live badge ─────────────────────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: #2ecc71;
  margin-left: 10px;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* ── Vote page ──────────────────────────────────── */
.vote-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 30px 20px;
  text-align: center;
}
.vote-logo {
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: 32px;
  text-transform: uppercase;
}
.vote-artist {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.2;
}
.vote-subtitle {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 36px;
}
.star-rating { display: flex; gap: 10px; justify-content: center; margin-bottom: 32px; }
.star-rating input[type="radio"] { display: none; }
.star-rating label {
  font-size: 3rem;
  cursor: pointer;
  color: #333;
  transition: color .15s, transform .1s;
  line-height: 1;
}
.star-rating label:hover,
.star-rating label.selected,
.star-rating input[type="radio"]:checked ~ label { color: #333; }
/* Star highlight — RTL trick */
.star-rating { flex-direction: row-reverse; }
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input[type="radio"]:checked ~ label {
  color: var(--gold);
  transform: scale(1.15);
}
.vote-btn {
  width: 100%;
  max-width: 320px;
  padding: 16px;
  font-size: 1.1rem;
  border-radius: 14px;
}
.error-msg {
  background: #3d1212;
  color: #ff7070;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: .88rem;
}

/* ── Vote done ───────────────────────────────────── */
.done-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}
.done-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 8px;
}
.done-label { color: var(--muted); font-size: .9rem; margin-bottom: 32px; }

/* ── パルトネール ピンクテーマ（投票・QR画面のみ） ───── */
/* body.vote-theme を付けたページだけ薄いピンク背景＋濃色テキストに。
   CSS変数を上書きして var(--muted)/var(--light) 利用箇所も一括で読みやすく。 */
body.vote-theme {
  --light: #3a232e;   /* 本文テキスト（濃色） */
  --muted: #9c7682;   /* 補助テキスト */
  background: linear-gradient(165deg, #fdeef3 0%, #f7d9e3 100%);
  background-attachment: fixed;
  color: #3a232e;
}
/* 未選択スターは淡いピンクグレー、選択/ホバーは従来どおりゴールド */
body.vote-theme .star-rating label { color: #ecc9d4; }
body.vote-theme .star-rating label:hover,
body.vote-theme .star-rating label:hover ~ label,
body.vote-theme .star-rating input[type="radio"]:checked ~ label {
  color: var(--gold);
  transform: scale(1.15);
}
body.vote-theme .done-score { color: var(--accent); }
body.vote-theme .error-msg { background: #fbdcdc; color: #c0392b; }

/* ── Calendar import modal ──────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent);
}
.cal-event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #12121f;
  margin-bottom: 8px;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.cal-event-item:hover { border-color: var(--accent); }
.cal-event-item input[type="checkbox"] { accent-color: var(--accent); }
.cal-event-name { font-size: .9rem; font-weight: 600; }
.cal-event-time { font-size: .75rem; color: var(--muted); }

/* ── Misc ────────────────────────────────────────── */
.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.page-sub {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 24px;
}
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: .9rem;
}
.tag {
  display: inline-block;
  background: #2a2a3d;
  color: var(--muted);
  font-size: .72rem;
  padding: 3px 9px;
  border-radius: 20px;
}

@media (max-width: 500px) {
  .performer-row {
    grid-template-columns: 24px 1fr auto auto;
    gap: 8px;
  }
  .vote-artist { font-size: 1.6rem; }
  .star-rating label { font-size: 2.4rem; }
}
