:root {
  --bg: #eef1f5;
  --bg-grid: rgba(0, 120, 180, 0.06);
  --card: #fafbfc;
  --card-elevated: #f3f4f6;
  --primary: #0099dd;
  --primary-dark: #0077aa;
  --accent-glow: rgba(0, 153, 221, 0.35);
  --text: #1f2933;
  --muted: #6b7280;
  --border: #d1d5db;
  --border-bright: rgba(0, 153, 221, 0.45);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --female: #dc2626;
  --first: #ca8a04;
  --unconfirmed: #7c3aed;
  --unconfirmed-bg: rgba(124, 58, 237, 0.1);
}

* {
  box-sizing: border-box;
}

body.cyber-cal {
  margin: 0;
  font-family: "Rajdhani", "Segoe UI", "Hiragino Sans", "Meiryo", sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

body.cyber-cal > header {
  background: linear-gradient(165deg, #7b8494 0%, #6b7280 45%, #5c6573 100%);
  color: #f3f4f6;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  border-bottom: 1px solid #4b5563;
  position: relative;
}

body.cyber-cal > header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 153, 221, 0.55), transparent);
  opacity: 0.85;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

body.cyber-cal .header-top {
  align-items: center;
}

body.cyber-cal .header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
  text-align: center;
}

body.cyber-cal .header-brand-img {
  display: block;
  height: clamp(3.5rem, 22vw, 4.25rem);
  width: auto;
  max-width: min(340px, 88vw);
  margin-inline: auto;
  object-fit: contain;
  object-position: center center;
}

body.cyber-cal > header .subtitle {
  width: 100%;
  text-align: center;
}

@media (min-width: 600px) {
  body.cyber-cal .header-brand-img {
    height: 2.65rem;
    max-width: 200px;
  }
}

@media (min-width: 960px) {
  body.cyber-cal .header-brand-img {
    height: 2.35rem;
    max-width: 168px;
  }
}

body.cyber-cal > header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1a2332;
  text-shadow: 0 0 20px rgba(0, 153, 221, 0.15);
}

body.cyber-cal > header .subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: rgba(243, 244, 246, 0.88);
  font-family: "Orbitron", "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
}

body.cyber-cal .btn-refresh,
body.cyber-cal .btn-header-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border: 1px solid #fff;
  border-radius: 3px;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

body.cyber-cal .btn-refresh {
  background: rgba(0, 130, 190, 0.9);
}

body.cyber-cal .btn-refresh:hover:not(:disabled) {
  background: rgba(0, 150, 210, 1);
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-refresh:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

body.cyber-cal .btn-header-link--instagram {
  background: linear-gradient(
    135deg,
    #f9ce34 0%,
    #ee2a7b 35%,
    #6228d7 68%,
    #8134af 100%
  );
  color: #fff;
  box-shadow: 0 2px 8px rgba(131, 58, 180, 0.35);
}

body.cyber-cal .btn-header-link--instagram:hover {
  background: linear-gradient(
    135deg,
    #ffd54f 0%,
    #f03e8c 35%,
    #7c3aed 68%,
    #9333ea 100%
  );
  box-shadow: 0 4px 14px rgba(238, 42, 123, 0.45);
}

body.cyber-cal .btn-header-link--youtube {
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
}

body.cyber-cal .btn-header-link--youtube:hover {
  background: rgba(220, 38, 38, 1);
}

body.cyber-cal .btn-header-link--stats {
  background: rgba(22, 163, 74, 0.9);
  color: #fff;
}

body.cyber-cal .btn-header-link--stats:hover {
  background: rgba(34, 197, 94, 1);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.45);
}

.btn-header-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

body.cyber-cal .header-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

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

.status {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.status.is-visible {
  display: block;
}

body.cyber-cal .status--loading {
  background: #e0f2fe;
  color: var(--primary-dark);
  border: 1px solid var(--border-bright);
}

body.cyber-cal .status--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

body.cyber-cal .error-banner {
  text-align: center;
  padding: 2rem 1rem;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 3px;
  margin-bottom: 1rem;
}

.calendars {
  display: grid;
  gap: 1.25rem;
}

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

body.cyber-cal .month-card {
  background: var(--card);
  border-radius: 3px;
  box-shadow: var(--shadow), 0 0 0 1px var(--border);
  overflow: hidden;
  border: 1px solid var(--border-bright);
}

body.cyber-cal .month-title {
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  font-family: "Orbitron", "Rajdhani", sans-serif;
  background: linear-gradient(90deg, rgba(0, 153, 221, 0.12), transparent);
  border-bottom: 1px solid var(--border-bright);
  color: #0c4a6e;
}

.weekdays,
.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
}

body.cyber-cal .weekdays span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.45rem 0;
  background: var(--card-elevated);
  border-bottom: 1px solid var(--border);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.05em;
}

body.cyber-cal .weekdays .sun {
  color: #dc2626;
}

body.cyber-cal .weekdays .sat {
  color: #0284c7;
}

body.cyber-cal .day-cell {
  min-width: 0;
  min-height: 80px;
  border: 1px solid var(--border);
  padding: 3px;
  background: #fff;
  overflow: hidden;
  transition: background 0.12s;
}

body.cyber-cal .day-cell--empty {
  background: #f3f4f6;
  border-color: #e5e7eb;
  min-height: 80px;
  pointer-events: none;
  opacity: 0.65;
}

body.cyber-cal .day-cell.past {
  background: #f5f6f8;
  opacity: 0.85;
}

body.cyber-cal .day-cell.past .day-num,
body.cyber-cal .day-cell.past .event-chip {
  color: #9ca3af;
}

body.cyber-cal .day-cell.past .event-chip {
  background: #e5e7eb;
  border-color: #d1d5db;
}

body.cyber-cal .day-cell.today {
  background: #fffbeb;
  box-shadow: inset 0 0 0 2px var(--primary), 0 0 10px rgba(0, 153, 221, 0.15);
}

body.cyber-cal .day-cell.today .day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 2px;
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 0 8px var(--accent-glow);
  font-family: "Orbitron", sans-serif;
}

body.cyber-cal .day-num {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 2px;
  font-family: "Orbitron", sans-serif;
}

body.cyber-cal .day-num.sun {
  color: #dc2626;
}

body.cyber-cal .day-num.sat {
  color: #0284c7;
}

body.cyber-cal .event-chip {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  border: 1px solid rgba(0, 153, 221, 0.35);
  border-radius: 2px;
  background: #e8f4fc;
  color: #0c4a6e;
  font-size: 0.58rem;
  padding: 2px 4px;
  margin-bottom: 2px;
  cursor: pointer;
  line-height: 1.2;
  overflow-wrap: anywhere;
  transition: background 0.12s, box-shadow 0.12s;
}

body.cyber-cal .event-chip:hover {
  background: #d2e8f8;
  box-shadow: 0 0 8px rgba(0, 153, 221, 0.25);
}

body.cyber-cal .event-chip.is-full {
  background: #fee2e2;
  color: #991b1b;
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.25);
}

body.cyber-cal .event-chip.is-full:hover {
  background: #fecaca;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.2);
}

body.cyber-cal .day-cell.past .event-chip.is-full {
  background: #f3e8e8;
  color: #9ca3af;
  box-shadow: none;
}

.event-chip .chip-line {
  display: block;
  font-size: 0.52rem;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-all;
}

body.cyber-cal .event-chip .chip-line--place {
  display: flex;
  align-items: flex-start;
  gap: 0.2em;
  word-break: break-word;
}

body.cyber-cal .event-chip .chip-pin {
  display: inline-flex;
  flex-shrink: 0;
  width: 0.72em;
  min-width: 8px;
  height: 0.72em;
  min-height: 8px;
  margin-top: 0.05em;
  color: #0284c7;
}

body.cyber-cal .event-chip .chip-pin-icon {
  display: block;
  width: 100%;
  height: 100%;
}

body.cyber-cal .event-chip.is-full .chip-pin {
  color: #dc2626;
}

body.cyber-cal .day-cell.past .event-chip .chip-pin {
  color: #6b7280;
}

body.cyber-cal .event-chip .chip-place-name {
  min-width: 0;
  flex: 1;
}

.event-chip .chip-line + .chip-line {
  margin-top: 1px;
}

.event-chip .chip-line--time {
  font-size: 0.5rem;
  font-weight: 500;
  opacity: 0.88;
  word-break: keep-all;
}

.event-chip .chip-line--time + .chip-line--time-end {
  margin-top: 0;
}

.event-chip .chip-line--count {
  font-weight: 700;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 2, 8, 0.88);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

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

.modal--lineup {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 94vh;
  overflow-y: auto;
  background: #00050a;
  color: #fff;
  border-radius: 4px;
  box-shadow:
    0 0 40px rgba(0, 170, 255, 0.25),
    0 24px 48px rgba(0, 0, 0, 0.6);
  background-image:
    linear-gradient(rgba(0, 170, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 170, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center bottom;
}

.lineup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 5;
  border: 1px solid rgba(0, 170, 255, 0.45);
  background: rgba(0, 20, 40, 0.85);
  color: #7dd3fc;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.lineup-close:hover {
  background: rgba(0, 80, 140, 0.5);
  box-shadow: 0 0 12px rgba(0, 170, 255, 0.5);
}

.lineup-scene {
  padding: 1.25rem 1rem 1rem;
}

.modal--lineup .lineup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-right: 2rem;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #fff;
}

.modal--lineup .lineup-header::after {
  display: none;
}

.lineup-date-block {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.lineup-year {
  writing-mode: vertical-rl;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.55);
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  font-weight: 600;
  padding-bottom: 0.15rem;
  flex-shrink: 0;
}

.lineup-date-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
}

.modal--lineup .lineup-date-main {
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 170, 255, 0.35);
}

.lineup-date-dow {
  font-size: 1.35rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.02em;
}

.lineup-time-slot {
  font-size: 0.95rem;
  font-weight: 600;
  color: #7dd3fc;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.lineup-venue {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.04em;
}

.lineup-venue svg {
  flex-shrink: 0;
  color: #00aaff;
  opacity: 0.9;
}

.lineup-frame {
  position: relative;
  border: 2px solid #00aaff;
  border-radius: 2px;
  padding: 0.35rem 0.5rem 0.5rem;
  box-shadow:
    0 0 18px rgba(0, 170, 255, 0.55),
    inset 0 0 24px rgba(0, 170, 255, 0.08);
  background: rgba(0, 8, 18, 0.92);
  overflow: hidden;
}

.lineup-table {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.lineup-row {
  display: grid;
  grid-template-columns: 1.6rem 2.4rem 1fr;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.15rem;
  border-bottom: 1px solid rgba(0, 170, 255, 0.12);
  font-size: 0.88rem;
  min-height: 2.1rem;
}

.lineup-row:last-child {
  border-bottom: none;
}

.lineup-row--empty {
  opacity: 0.45;
}

.lineup-row--first .lineup-name {
  color: #fde68a;
}

.lineup-row--female .lineup-name {
  color: #fca5a5;
}

.lineup-row--unconfirmed .lineup-name {
  color: #c4b5fd;
}

.lineup-order {
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.lineup-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  justify-content: center;
}

.lineup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  padding: 0.1rem 0.2rem;
  background: #fff;
  color: #00050a;
  font-size: 0.62rem;
  font-weight: 800;
  border-radius: 2px;
  line-height: 1.1;
}

.lineup-badge--first {
  background: #fef08a;
  color: #713f12;
}

.lineup-badge--female {
  background: #fecaca;
  color: #7f1d1d;
}

.lineup-badge--pending {
  background: #ddd6fe;
  color: #4c1d95;
}

.lineup-badge--empty {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.25);
  min-width: 1.15rem;
}

.lineup-name {
  font-weight: 600;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.lineup-count {
  margin: 0.65rem 0 0;
  text-align: center;
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #7dd3fc;
}

.lineup-form-message {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  text-align: center;
  color: #f87171;
}

.modal-loading--lineup {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(0, 5, 10, 0.92);
  color: #7dd3fc;
  font-size: 0.85rem;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.08em;
}

.modal-loading--lineup.visible {
  display: flex;
}

.loading-spinner--lineup {
  border-color: rgba(0, 170, 255, 0.2);
  border-top-color: #00aaff;
}

footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
