@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --c-bg: #E96D47;
  --c-bg-dark: #C85A3A;
  --c-card: #FFFFFF;
  --c-text: #1B1B1B;
  --c-text-on-bg: #FFFFFF;
  --c-text-muted: rgba(27, 27, 27, 0.55);
  --c-text-faint: rgba(27, 27, 27, 0.35);
  --c-code-bg: #2B2B2B;
  --c-code-text: #F0EEEB;
  --c-code-accent: #F5C76A;
  --c-card-shadow: rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #000;
  color: var(--c-text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Slide Stage ── */
.slide-stage {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background: #000;
}

#slide-frame {
  width: 100vw;
  height: 100vh;
  max-width: calc(100vh * 16 / 9);
  max-height: calc(100vw * 9 / 16);
  position: relative;
  overflow: hidden;
  container-type: inline-size;
  container-name: slide;
}

/* ── Slide Base (Orange background) ── */
.slide {
  position: absolute;
  inset: 0;
  padding: 5cqw 6cqw;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
  background: var(--c-bg);
  color: var(--c-text-on-bg);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}

/* flex spacers: コンテンツが少ない時はセンタリング、多い時は潰れてスクロール可 */
.slide::before,
.slide::after {
  content: "";
  flex: 1 0 0px;
}

.slide::-webkit-scrollbar {
  width: 0.6cqw;
}
.slide::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 0.3cqw;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Cover (full-bleed image) ── */
.slide.layout-cover {
  padding: 0;
  background: #000;
  justify-content: center;
  overflow: hidden;
}
.slide.layout-cover::before,
.slide.layout-cover::after { display: none; }

.cover-img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  flex-shrink: 0;
}

/* ── Section Divider (Darker) ── */
.slide.layout-section {
  background: var(--c-text);
  color: var(--c-text-on-bg);
  align-items: center;
  text-align: center;
  justify-content: center;
}
.slide.layout-section::before,
.slide.layout-section::after { display: none; }

/* ── Typography (cqw) ── */
.slide-h1 {
  font-size: 4.5cqw;
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.slide-h2 {
  font-size: 3cqw;
  line-height: 1.25;
  font-weight: 700;
}

.slide-title {
  font-size: 3.5cqw;
  line-height: 1.2;
  font-weight: 700;
}

.slide-body {
  font-size: 1.7cqw;
  line-height: 1.7;
  font-weight: 400;
  opacity: 0.85;
}

.slide-small {
  font-size: 1.2cqw;
  line-height: 1.5;
  font-weight: 400;
  opacity: 0.6;
}

/* ── Headline ── */
.headline {
  margin-bottom: 1.5cqw;
  white-space: pre-line;
  flex-shrink: 0;
}

/* ── Body text ── */
.body-text {
  white-space: pre-line;
}

/* ── White Card ── */
.card {
  background: var(--c-card);
  border-radius: 1.2cqw;
  padding: 2.5cqw 3cqw;
  color: var(--c-text);
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
}

/* ── Items Grid (cards) ── */
.items-grid {
  display: flex;
  gap: 2cqw;
  margin-top: 2cqw;
}

.item-card {
  flex: 1;
  background: var(--c-card);
  border-radius: 1.2cqw;
  padding: 2cqw 2.2cqw;
  color: var(--c-text);
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.6cqw;
}

.item-icon {
  font-size: 2.5cqw;
  line-height: 1;
  margin-bottom: 0.3cqw;
}

.item-icon.numbered {
  width: 3cqw;
  height: 3cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  color: #fff;
  border-radius: 50%;
  font-size: 1.6cqw;
  font-weight: 900;
}

.item-icon.slash {
  width: 3cqw;
  height: 3cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-text);
  color: var(--c-card);
  border-radius: 0.5cqw;
  font-size: 1.8cqw;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
}

.item-label {
  font-size: 1.8cqw;
  font-weight: 700;
  color: var(--c-text);
}

.item-desc {
  font-size: 1.3cqw;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ── Code Block (dark terminal style) ── */
.code-block {
  background: var(--c-code-bg);
  color: var(--c-code-text);
  padding: 2.2cqw 2.8cqw;
  border-radius: 1cqw;
  font-family: 'JetBrains Mono', 'Menlo', monospace;
  font-size: 1.4cqw;
  line-height: 1.9;
  white-space: pre-line;
  margin-top: 2cqw;
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
  position: relative;
  flex-shrink: 1;
  min-height: 0;
  overflow-y: auto;
}

.code-block .code-label {
  position: absolute;
  top: 0.8cqw;
  right: 1.2cqw;
  font-size: 0.9cqw;
  opacity: 0.4;
  font-weight: 400;
}

.code-block .code-prompt {
  color: var(--c-code-accent);
  font-weight: 700;
}

.code-block .code-comment {
  opacity: 0.45;
}

.code-line-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.6cqw;
  border-radius: 0.3cqw;
  padding: 0.1cqw 0.3cqw;
  margin: 0 -0.3cqw;
  transition: background 150ms;
  position: relative;
  z-index: 200;
}

.code-line-copy:hover {
  background: rgba(255, 255, 255, 0.08);
}

.copy-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.45);
  font-size: 1cqw;
  padding: 0.15cqw 0.4cqw;
  border-radius: 0.25cqw;
  line-height: 1;
  transition: color 150ms, border-color 150ms, background 150ms;
}

.code-line-copy:hover .copy-btn {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.5);
}

.copy-btn.copied {
  color: #4ade80;
  border-color: #4ade80;
  position: relative;
}

.copy-tooltip {
  position: absolute;
  bottom: calc(100% + 0.5cqw);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: var(--c-text);
  font-size: 0.9cqw;
  font-weight: 700;
  padding: 0.3cqw 0.8cqw;
  border-radius: 0.3cqw;
  white-space: nowrap;
  box-shadow: 0 0.2cqw 0.8cqw rgba(0, 0, 0, 0.2);
  animation: tooltipPop 200ms ease;
  pointer-events: none;
}

.copy-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 0.4cqw solid transparent;
  border-top-color: #fff;
}

@keyframes tooltipPop {
  from { opacity: 0; transform: translateX(-50%) translateY(0.3cqw); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Pricing Grid ── */
.pricing-grid {
  display: flex;
  gap: 1.5cqw;
  margin-top: 2cqw;
}

.pricing-card {
  flex: 1;
  background: var(--c-card);
  border-radius: 1.2cqw;
  padding: 2cqw 1.8cqw;
  color: var(--c-text);
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6cqw;
  position: relative;
}

.pricing-card.recommended {
  border: 0.25cqw solid var(--c-bg);
}

.pricing-badge {
  position: absolute;
  top: -0.9cqw;
  background: var(--c-bg);
  color: #fff;
  font-size: 0.85cqw;
  font-weight: 700;
  padding: 0.2cqw 0.9cqw;
  border-radius: 0.4cqw;
}

.pricing-name {
  font-size: 1.6cqw;
  font-weight: 700;
}

.pricing-price {
  font-size: 2.2cqw;
  font-weight: 900;
  color: var(--c-bg);
}

.pricing-limit {
  font-size: 1.1cqw;
  color: var(--c-text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── File Tree ── */
.file-tree {
  background: var(--c-code-bg);
  color: var(--c-code-text);
  border-radius: 1cqw;
  padding: 2cqw 2.5cqw;
  margin-top: 2cqw;
  font-family: 'JetBrains Mono', 'Menlo', monospace;
  font-size: 1.3cqw;
  line-height: 2;
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
}

.ft-row {
  display: flex;
  align-items: baseline;
  gap: 0.6cqw;
}

.ft-blank {
  height: 1cqw;
}

.ft-icon {
  font-size: 1.2cqw;
  flex-shrink: 0;
}

.ft-name {
  font-weight: 700;
  white-space: nowrap;
}

.ft-desc {
  color: var(--c-code-accent);
  font-size: 1cqw;
  opacity: 0.7;
  white-space: nowrap;
}

/* ── Image Layout ── */
.slide.layout-image {
  align-items: center;
  justify-content: center;
  padding: 3cqw;
  background: var(--c-bg);
}

.fullimage-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fullimage {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-height: 0;
}

.slide-image {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 0.8cqw;
  box-shadow: 0 0.5cqw 2cqw rgba(0, 0, 0, 0.3);
}

.image-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2cqw;
  flex: 1;
  width: 100%;
  min-height: 0;
}

.image-row .slide-image {
  max-width: 45%;
  max-height: 85%;
}

/* ── QR Section ── */
/* ── Dual QR ── */
.dual-qr-section {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12cqw;
  margin-top: 2cqw;
  position: relative;
  z-index: 200;
}

.dual-qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2cqw;
  text-decoration: none;
  transition: transform 150ms;
}

.dual-qr-item:hover {
  transform: translateY(-0.3cqw);
}

.dual-qr-image {
  width: 20cqw;
  height: 20cqw;
  border-radius: 1cqw;
  box-shadow: 0 0.4cqw 1.5cqw rgba(0, 0, 0, 0.15);
}

.dual-qr-label {
  font-size: 2cqw;
  font-weight: 700;
  color: #fff;
}

.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5cqw;
  margin-top: 1cqw;
  position: relative;
  z-index: 200;
}

.qr-image {
  width: 22cqw;
  height: 22cqw;
  border-radius: 1cqw;
  box-shadow: 0 0.4cqw 1.5cqw rgba(0, 0, 0, 0.15);
}

/* ── Data Table ── */
.data-table {
  margin-top: 1.5cqw;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-radius: 0.8cqw;
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
  position: relative;
  z-index: 60;
}

.data-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-card);
  color: var(--c-text);
  font-size: 1.15cqw;
  line-height: 1.5;
  table-layout: fixed;
}

.data-table colgroup col:nth-child(1) { width: 38%; }
.data-table colgroup col:nth-child(2) { width: 25%; }
.data-table colgroup col:nth-child(3) { width: 37%; }

.data-table thead th {
  background: var(--c-text);
  color: #fff;
  font-weight: 700;
  font-size: 1.05cqw;
  padding: 0.6cqw 1cqw;
  text-align: left;
}

.data-table tbody td {
  padding: 0.5cqw 1cqw;
  border-bottom: 1px solid rgba(27, 27, 27, 0.08);
  vertical-align: top;
  word-break: break-all;
}

.data-table tbody td:first-child {
  font-weight: 700;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-section-row td {
  background: var(--c-bg);
  color: #fff;
  font-weight: 700;
  font-size: 1.1cqw;
  padding: 0.5cqw 1.2cqw !important;
}

.table-scroll-hint {
  text-align: center;
  font-size: 1.35cqw;
  color: #fff;
  opacity: 0.8;
  padding: 0.6cqw 0;
}

.table-footnote {
  margin-top: 1cqw;
  font-size: 1.1cqw;
  opacity: 0.85;
  text-align: center;
}

/* ── Align Center modifier ── */
.slide.align-center {
  align-items: center;
  text-align: center;
}

/* ── Center Link Button ── */
.center-link-wrap {
  margin-top: 3cqw;
  text-align: center;
}

.center-link-wrap {
  position: relative;
  z-index: 200;
}

.center-link-btn {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  border: 0.2cqw solid #fff;
  padding: 1cqw 3cqw;
  border-radius: 0.6cqw;
  font-size: 2cqw;
  font-weight: 700;
  position: relative;
  z-index: 200;
  transition: background 150ms, color 150ms;
}

.center-link-btn:hover {
  background: #fff;
  color: var(--c-bg);
}

/* ── Left-Right Layout ── */
.slide.layout-left-right {
  flex-direction: column;
}

.lr-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5cqw;
  margin-top: 2cqw;
  width: 100%;
}

.lr-card {
  background: var(--c-card);
  border-radius: 1.2cqw;
  padding: 2.5cqw;
  display: flex;
  flex-direction: column;
  gap: 0.8cqw;
  color: var(--c-text);
  box-shadow: 0 0.4cqw 1.5cqw var(--c-card-shadow);
}

.lr-card.recommended {
  border: 0.2cqw solid var(--c-bg);
  position: relative;
}

.lr-card-badge {
  position: absolute;
  top: -1cqw;
  left: 2cqw;
  background: var(--c-bg);
  color: #fff;
  font-size: 0.9cqw;
  font-weight: 700;
  padding: 0.3cqw 1cqw;
  border-radius: 0.4cqw;
}

.lr-card-title {
  font-size: 2cqw;
  font-weight: 700;
}

.lr-card-price {
  font-size: 2.8cqw;
  font-weight: 900;
  color: var(--c-bg);
}

.lr-card-point {
  font-size: 1.3cqw;
  color: var(--c-text-muted);
  line-height: 1.6;
}

.lr-card-point::before {
  content: '・';
}

/* ── Item Link ── */
.item-link {
  text-decoration: none;
  cursor: pointer;
  position: relative;
  z-index: 60;
  transition: transform 150ms, box-shadow 150ms;
}

.item-link:hover {
  transform: translateY(-0.3cqw);
  box-shadow: 0 0.6cqw 2cqw var(--c-card-shadow);
}

/* ── Footer Link ── */
.footer-link {
  color: #fff;
  text-decoration: none;
  border: 0.15cqw solid #fff;
  padding: 0.5cqw 1.5cqw;
  border-radius: 0.5cqw;
  font-weight: 700;
  font-size: 1.3cqw;
  position: relative;
  z-index: 200;
  transition: background 150ms, color 150ms;
  display: inline-block;
}

.footer-link:hover {
  background: #fff;
  color: var(--c-bg);
}

/* ── Footer ── */
.slide-footer {
  margin-top: auto;
  padding-top: 2cqw;
  font-size: 1.1cqw;
  line-height: 1.7;
  white-space: pre-line;
  position: relative;
  z-index: 200;
}

/* ── Status Bar ── */
.status-bar {
  position: absolute;
  top: 1.5cqw;
  right: 2cqw;
  display: flex;
  align-items: center;
  gap: 1.5cqw;
  z-index: 100;
}

.status-info {
  font-size: 1cqw;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 0.8cqw;
}

.menu-btn {
  width: 2.5cqw;
  height: 2.5cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.8cqw;
  border-radius: 0.4cqw;
  transition: color 150ms;
}

.menu-btn:hover {
  color: #fff;
}

/* ── Sidebar ── */
.sidebar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  z-index: 200;
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 30cqw;
  height: 100%;
  background: var(--c-card);
  transform: translateX(100%);
  transition: transform 300ms ease;
  z-index: 210;
  display: flex;
  flex-direction: column;
  padding: 3cqw;
  overflow-y: auto;
}

.sidebar-overlay.open .sidebar {
  transform: translateX(0);
}

.sidebar-title {
  font-size: 1.5cqw;
  font-weight: 700;
  margin-bottom: 2cqw;
  padding-bottom: 1cqw;
  border-bottom: 1px solid rgba(27, 27, 27, 0.1);
  color: var(--c-text);
}

.sidebar-agenda {
  margin-bottom: 1.5cqw;
}

.sidebar-agenda-label {
  font-size: 1.1cqw;
  font-weight: 700;
  color: var(--c-text-faint);
  margin-bottom: 0.5cqw;
  display: flex;
  justify-content: space-between;
}

.sidebar-slide-item {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 1cqw;
  padding: 0.5cqw 0.8cqw;
  border: none;
  background: transparent;
  color: var(--c-text);
  cursor: pointer;
  border-radius: 0.3cqw;
  line-height: 1.4;
  font-family: 'Noto Sans JP', sans-serif;
  transition: background 100ms;
}

.sidebar-slide-item:hover {
  background: rgba(212, 132, 90, 0.08);
}

.sidebar-slide-item.current {
  background: rgba(212, 132, 90, 0.15);
  color: var(--c-bg-dark);
  font-weight: 700;
}

/* ── Talk Script ── */
.script-trigger {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3cqw;
  z-index: 150;
}

.script-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 30%;
  background: rgba(27, 27, 27, 0.94);
  color: #f0eeeb;
  padding: 2cqw 3cqw;
  font-size: 1.3cqw;
  line-height: 1.8;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 200ms ease;
  z-index: 160;
  white-space: pre-line;
  backdrop-filter: blur(8px);
}

.script-panel.visible {
  transform: translateY(0);
}

/* ── Navigation Areas ── */
.nav-left,
.nav-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 50;
  cursor: pointer;
}

.nav-left { left: 0; }
.nav-right { right: 0; }

/* ── Slide Counter ── */
.slide-counter {
  position: absolute;
  bottom: 1.5cqw;
  right: 2cqw;
  font-size: 1cqw;
  color: rgba(255, 255, 255, 0.25);
  z-index: 90;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
