@charset "utf-8";
:root {
  --bg-deep:        #ffffee;
  --bg-panel:       #f2f2f2;
  --bg-card:        #fff9f0;
  --bg-card2:       #faf0e6;
  --gold:           #0000ff;
  --gold-light:     #22aa55;
  --gold-dim:       #117743;
  --red:            rgb(0, 0, 255);
  --red-light:      #0022ee;
  --blue:           #0000cc;
  --blue-light:     #0055cc;
  --text-primary:   #222222;
  --text-secondary: #126e3f;
  --text-dim:       #555555;
  --border:         #aaaaaa;
  --border-gold:    #117743;
  --accent-green:   #117743;
}

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

/* ---- pill (スレ選択タブ等) ---- */
.pill.on {
  background: #117743;
  border-color: #0d5c33;
  color: #ffffff;
  transition: all .2s;
}

.system-message a {
  color: #0000cc;
}

.pill {
  font-size: 0.8rem;
  font-weight: normal;
  letter-spacing: .02em;
  text-transform: none;
  padding: 3px 12px;
  border-radius: 0;
  border: 1px solid #aaaaaa;
  color: #0000cc;
  transition: all .1s;
  margin-top: 4px;
  background: #f0e0d6;
  text-decoration: none !important;
  margin-right: 4px;
}

/* ---- body ---- */
body {
  font-family: 'MS PGothic', 'ＭＳ Ｐゴシック', 'Meiryo', 'メイリオ', 'Hiragino Kaku Gothic ProN', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.6;
}

body {
  background-size: auto;
  background-position: top left;
  background-repeat: repeat;
  background-attachment: scroll;
  min-height: 100vh;
}

.center-panel {
  background-color: #ffffeebb;
}

.results-bg {
  background-color: #ffffeebb;
  width: 100%;
}

/* 背景テクスチャ不要 → 無効化 */
body::before {
  content: none;
}

#root { position: relative; z-index: 1; }

/* =================== SETUP SCREEN =================== */
.setup-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #ffe18687;
}

.setup-emblem {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  position: relative;
}

.setup-emblem svg { width: 100%; height: 100%; }

.setup-title {
  font-family: 'MS PGothic', 'ＭＳ Ｐゴシック', sans-serif;
  font-size: 2rem;
  font-weight: bold;
  text-align: center;
  color: rgb(0, 0, 255);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
}

.setup-subtitle {
  font-size: 0.9rem;
  color: #333;
  text-align: center;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.setup-card {
  background: rgb(204, 255, 204);
  border: 2px solid #aaaaaa;
  /*border-top: 4px solid rgb(0, 0, 255);*/
  border-radius: 0;
  padding: 20px 28px;
  width: 100%;
  max-width: 460px;
}

.setup-section-title {
  font-family: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: #117743;
  text-transform: none;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
}

.setup-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #aaaaaa;
}

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  color: #333333;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #aaaaaa;
  border-radius: 0;
  padding: 6px 10px;
  color: #222222;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.1s;
  outline: none;
}

.form-input:focus { border-color: rgb(0, 0, 255); }

.gender-group {
  display: flex;
  gap: 8px;
}

.gender-btn {
  flex: 1;
  padding: 7px;
  background: #f0f0f0;
  border: 1px solid #aaaaaa;
  border-radius: 0;
  color: #333333;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.1s;
  letter-spacing: 0.05em;
}

.gender-btn.active {
  border-color: rgb(0, 0, 255);
  color: rgb(0, 0, 255);
  background: #eeeeff;
}

.start-btn {
  width: 100%;
  padding: 10px;
  background: rgb(0, 0, 255);
  border: 2px outset #3366ff;
  border-radius: 0;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.1s;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.start-btn::before { content: none; }

.start-btn:hover::before { content: none; }
.start-btn:hover {
  background: #0033ff;
  border-style: inset;
}

.setup-note {
  margin-top: 14px;
  font-size: 0.78rem;
  color: #333;
  text-align: center;
  line-height: 1.7;
}

 /* =================== MAIN SCREEN =================== */
  .main-screen {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
  }

  /* Header */
  .header {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(39,174,96,0.06);
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .header-logo {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.15em;
  }

  .header-session {
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    padding-left: 14px;
    border-left: 1px solid var(--border);
  }

  .round-indicator {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  .round-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    transition: all 0.3s;
  }

  .round-dot.done { background: var(--gold); border-color: var(--gold); }
  .round-dot.current { background: transparent; border-color: var(--gold); box-shadow: 0 0 8px rgba(39,174,96,0.5); animation: pulse 1.5s infinite; }

  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(39,174,96,0.5); }
    50% { box-shadow: 0 0 12px rgba(39,174,96,0.8); }
  }

  .round-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 8px;
    letter-spacing: 0.1em;
  }

  /* Main layout */
  .debate-layout {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 0;
    height: calc(100vh - 57px);
  }

  /* Left panel - scores */
  .left-panel {
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .panel-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    color: var(--gold-dim);
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-gold);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .panel-title-dot {
    width: 4px;
    height: 4px;
    background: var(--gold-dim);
    border-radius: 50%;
  }

  /* Score card */
  .score-section { }

  .score-vs {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
  }

  .score-side {
    flex: 1;
    padding: 14px 10px;
    text-align: center;
  }

  .score-side.questioner { border-right: 1px solid var(--border); }

  .score-role {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 4px;
  }

  .score-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
  }

  .score-number {
    font-family: 'Shippori Mincho', serif;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    transition: all 0.5s;
  }

  .score-number.q-score { color: #1a7a4a; }
  .score-number.pm-score { color: #27ae60; }

  .score-bar-wrap {
    margin-top: 12px;
    height: 6px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
  }

  .score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #1e8449);
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 3px;
  }

  .score-status {
    margin-top: 10px;
    font-size: 0.7rem;
    text-align: center;
    padding: 5px 8px;
    border-radius: 2px;
    letter-spacing: 0.1em;
  }

  .score-status.leading-q { background: rgba(26,122,74,0.1); color: #1a7a4a; }
  .score-status.leading-pm { background: rgba(39,174,96,0.1); color: #1e8449; }
  .score-status.tied { background: rgba(39,174,96,0.08); color: var(--gold); }

  /* Session info */
  .session-info {
    font-size: 0.7rem;
    color: var(--text-dim);
    line-height: 1.9;
    letter-spacing: 0.05em;
  }

  .session-info span { color: var(--text-secondary); }

  /* Score history */
  .score-history {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .score-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
    padding: 4px 0;
    border-bottom: 1px solid rgba(39,174,96,0.06);
  }

  .score-history-round {
    min-width: 20px;
    color: var(--text-dim);
  }

  .score-history-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-deep);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
  }

  .score-history-fill {
    height: 100%;
    background: #27ae60;
    border-radius: 2px;
    transition: width 0.5s;
  }

  .score-history-nums {
    display: flex;
    gap: 4px;
    font-size: 0.8rem;
  }

  .score-history-nums .q { color: #1a7a4a; }
  .score-history-nums .pm { color: #27ae60; }

  /* Center panel */
  .center-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }

  /* Session banner */
  .session-banner {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    flex-shrink: 0;
  }

  .session-tag {
    background: rgba(39,174,96,0.08);
    border: 1px solid var(--border-gold);
    color: var(--gold-dim);
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
  }

  /* Transcript */
  .transcript {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
  }

  .transcript::-webkit-scrollbar { width: 4px; }
  .transcript::-webkit-scrollbar-track { background: transparent; }
  .transcript::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  /* Speaker entry */
  .speaker-entry {
    animation: fadeInUp 0.4s ease;
  }

  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .speaker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }

  .speaker-badge {
    font-size: 0.62rem;
    letter-spacing: 0.15em;
    padding: 3px 8px;
    border-radius: 2px;
    font-weight: 700;
  }

  .badge-chairman {
    background: rgba(39,174,96,0.1);
    border: 1px solid var(--border-gold);
    color: var(--gold);
  }

  .badge-questioner {
    background: rgba(26,110,62,0.1);
    border: 1px solid rgba(26,110,62,0.25);
    color: #1a6e3e;
  }

  .badge-pm {
    background: rgba(39,174,96,0.1);
    border: 1px solid rgba(39,174,96,0.25);
    color: #1e8449;
  }

  .speaker-name-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
  }

  .speech-bubble {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 14px 16px;
    font-size: 0.88rem;
    line-height: 1.9;
    color: var(--text-primary);
    position: relative;
    box-shadow: 0 1px 4px rgba(39,174,96,0.04);
  }

  .speech-bubble.pm-bubble {
    background: var(--bg-card);
    border-color: rgba(39,174,96,0.2);
    border-left: 2px solid rgba(39,174,96,0.45);
  }

  .speech-bubble.q-bubble {
    border-left: 2px solid rgba(26,110,62,0.4);
  }

  .speech-bubble.chairman-bubble {
    border-left: 2px solid rgba(39,174,96,0.3);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.82rem;
  }

  .score-update-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 2px;
    margin-top: 8px;
    letter-spacing: 0.05em;
  }

  .score-update-badge.q-wins {
    background: rgba(26,110,62,0.1);
    color: #1a6e3e;
    border: 1px solid rgba(26,110,62,0.2);
  }

  .score-update-badge.pm-wins {
    background: rgba(39,174,96,0.1);
    color: #1e8449;
    border: 1px solid rgba(39,174,96,0.2);
  }

  .score-update-badge.neutral {
    background: rgba(39,174,96,0.06);
    color: var(--gold-dim);
    border: 1px solid var(--border-gold);
  }

  /* Typing indicator */
  .typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(39,174,96,0.2);
    border-left: 2px solid rgba(39,174,96,0.45);
    border-radius: 3px;
  }

  .typing-dot {
    width: 6px;
    height: 6px;
    background: #27ae60;
    border-radius: 50%;
    animation: typingBounce 1.2s infinite;
  }

  .typing-dot:nth-child(2) { animation-delay: 0.2s; }
  .typing-dot:nth-child(3) { animation-delay: 0.4s; }

  @keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
  }

  .typing-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    margin-left: 4px;
  }

  /* Input area */
  .input-area {
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    flex-shrink: 0;
  }

  .input-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .input-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
  }

  .char-count {
    font-size: 0.65rem;
    color: var(--text-dim);
  }

  .question-textarea {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.88rem;
    line-height: 1.7;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    min-height: 80px;
  }

  .question-textarea:focus { border-color: var(--gold-dim); }

  .question-textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .btn-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
  }

  .btn {
    flex: 1;
    padding: 11px 16px;
    border-radius: 3px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid;
    font-weight: 500;
    position: relative;
    overflow: hidden;
  }

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

  .btn-direct {
    background: var(--bg-deep);
    border-color: #a8d4b8;
    color: #1a6e3e;
  }

  .btn-direct:hover:not(:disabled) {
    background: rgba(39,174,96,0.07);
    border-color: #27ae60;
  }

  .btn-convert {
    background: linear-gradient(135deg, #d4eddc, #e8f5ec);
    border-color: #a8d4b8;
    color: #1a6e3e;
  }

  .btn-convert:hover:not(:disabled) {
    background: linear-gradient(135deg, #c6e8d0, #daf0e2);
    box-shadow: 0 0 12px rgba(39,174,96,0.15);
  }

  /* Right panel - PM thoughts */
  .right-panel {
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .thought-card {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-left: 2px solid #27ae60;
    border-radius: 3px;
    padding: 14px;
    animation: fadeInUp 0.4s ease;
  }

  .thought-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .thought-round {
    font-size: 0.62rem;
    color: #1e8449;
    letter-spacing: 0.2em;
    opacity: 0.9;
	font-weight:bold;
  }

  .thought-strategy {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(39,174,96,0.08);
    border: 1px solid rgba(39,174,96,0.2);
    border-radius: 2px;
    color: #1e8449;
  }

  .thought-item {
    font-size: 0.77rem;
    line-height: 1.8;
    color: #4a6e57;
    padding: 6px 0;
    border-bottom: 1px solid rgba(39,174,96,0.06);
  }

  .thought-item:last-child { border-bottom: none; }

  .thought-item-seron {
    background: rgba(39,174,96,0.05);
    padding: 6px 8px;
    border-radius: 2px;
    border-bottom: 1px solid rgba(39,174,96,0.12) !important;
    margin-top: 2px;
  }
  .thought-item-seron .thought-item-label {
    color: var(--gold-dim) !important;
  }

  .thought-item-label {
    font-size: 0.80rem;
    color: #1e8449;
    letter-spacing: 0.15em;
    margin-bottom: 3px;
    opacity: 0.7;
  }

  .thought-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px;
    font-size: 0.75rem;
    color: var(--text-dim);
  }

  .spin {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: #27ae60;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin { to { transform: rotate(360deg); } }

  /* =================== RESULTS SCREEN =================== */
  .results-screen {
    min-height: 100vh;
    padding: 40px 20px;
    max-width: 900px;
    margin: 0 auto;
  }

  .results-header {
    text-align: center;
    margin-bottom: 40px;
  }

  .results-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 0.2em;
    margin-bottom: 8px;
  }

  .results-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.2em;
  }

  .winner-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(39,174,96,0.07);
  }

  .winner-banner {
    padding: 20px 24px;
    text-align: center;
  }

  .winner-banner.q-wins { background: linear-gradient(135deg, rgb(165, 255, 203), rgb(165, 255, 203)); border-bottom: 2px solid #1a6e3e; }
  .winner-banner.pm-wins { background: linear-gradient(135deg, rgb(165, 255, 203), rgb(165, 255, 203)); border-bottom: 2px solid #27ae60; }
  .winner-banner.draw { background: linear-gradient(135deg, rgb(165, 255, 203), rgb(165, 255, 203)); border-bottom: 2px solid var(--gold); }

  .winner-text {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.2em;
  }

  .winner-text.q-color { color: #000; }
  .winner-text.pm-color { color: #000; }
  .winner-text.draw-color { color: #000; }

  .winner-score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
  }

  .final-score {
    text-align: center;
  }

  .final-score-num {
    font-family: 'Shippori Mincho', serif;
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
  }

  .final-score-label {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    margin-top: 4px;
  }

  .score-vs-label {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.5rem;
    color: var(--text-dim);
  }

  /* Analysis sections */
  .analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  .analysis-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(39,174,96,0.05);
  }

  .analysis-card-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    color: var(--gold-dim);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-gold);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .analysis-text {
    font-size: 0.84rem;
    line-height: 1.9;
    color: var(--text-secondary);
  }

  .damage-meter {
    margin-top: 14px;
  }

  .damage-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
  }

  .damage-bar {
    height: 8px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
  }

  .damage-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
  }

  .damage-fill.high { background: linear-gradient(90deg, #c0392b, #e74c3c); }
  .damage-fill.medium { background: linear-gradient(90deg, #e67e22, #f39c12); }
  .damage-fill.low { background: linear-gradient(90deg, #1e8449, #27ae60); }

  .approval-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 12px;
  }

  .approval-number {
    font-family: 'Shippori Mincho', serif;
    font-size: 2.4rem;
    font-weight: 800;
  }

  .approval-change {
    font-size: 0.9rem;
    font-weight: 700;
  }

  .approval-change.down { color: #c0392b; }
  .approval-change.up { color: #1e8449; }

  .restart-btn {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 30px auto 0;
    padding: 16px;
    background: var(--bg-panel);
    border: 1px solid var(--border-gold);
    border-radius: 3px;
    color: var(--gold);
    font-family: 'Noto Serif JP', serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
  }

  .restart-btn:hover {
    background: rgba(39,174,96,0.06);
    box-shadow: 0 0 20px rgba(39,174,96,0.12);
  }

  .tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

  .tag {
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
  }

  .tag-blue { background: rgba(26,110,62,0.08); border: 1px solid rgba(26,110,62,0.2); color: #1a6e3e; }
  .tag-red { background: rgba(39,174,96,0.08); border: 1px solid rgba(39,174,96,0.2); color: #1e8449; }
  .tag-gold { background: rgba(39,174,96,0.06); border: 1px solid var(--border-gold); color: var(--gold); }

  /* Scrollbar */
  .left-panel::-webkit-scrollbar,
  .right-panel::-webkit-scrollbar { width: 3px; }
  .left-panel::-webkit-scrollbar-thumb,
  .right-panel::-webkit-scrollbar-thumb { background: var(--border); }

  /* API key modal */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(230,240,234,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
  }

  .modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-top: 2px solid var(--gold-dim);
    border-radius: 4px;
    padding: 32px 36px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 8px 40px rgba(39,174,96,0.1);
  }

  .modal-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 1rem;
    color: var(--gold);
    letter-spacing: 0.15em;
    margin-bottom: 8px;
  }

  .modal-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
  }

  .modal-input {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 14px;
  }

  .modal-input:focus { border-color: var(--gold-dim); }

  .modal-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #1a6e3e, #27ae60);
    border: 1px solid var(--gold-dim);
    border-radius: 3px;
    color: #ffffff;
    font-family: 'Noto Serif JP', serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.2s;
  }

  .modal-btn:hover { box-shadow: 0 0 16px rgba(39,174,96,0.2); }

  .error-msg {
    font-size: 0.72rem;
    color: #c0392b;
    margin-top: 8px;
    min-height: 16px;
  }

  @media (max-width: 900px) {
    .debate-layout { grid-template-columns: 200px 1fr 240px; }
  }

  @media (max-width: 700px) {
    .debate-layout {
      grid-template-columns: 1fr;
      grid-template-rows: auto 1fr auto;
      height: auto;
    }
    .left-panel, .right-panel { max-height: 200px; }
    .analysis-grid { grid-template-columns: 1fr; }
    .setup-card { padding: 24px; }
  }
  
  .footerexp{
      margin-top:20px;
      font-size:13px;
      color:#555;
      text-align:center;
      font-weight:bold;
  }
  .footerexp a{
      color:#555;
      text-decoration: none;
      font-weight:bold;
  }
  
  
  /* Advisor panel */
  .advisor-card {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-left: 2px solid var(--blue-light);
    border-radius: 3px;
    padding: 14px;
    animation: fadeInUp 0.4s ease;
  }

  .advisor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .advisor-round {
    font-size: 0.7rem;
    color: var(--blue-light);
    letter-spacing: 0.2em;
    font-weight: bold;
  }

  .advisor-item {
    font-size: 0.77rem;
    line-height: 1.8;
    color: #676868;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }

  .advisor-item:last-child { border-bottom: none; }

  .advisor-item-label {
    font-size: 0.80rem;
    letter-spacing: 0.12em;
    margin-bottom: 3px;
    font-weight: 600;
  }

  .advisor-example {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(41,128,185,0.07);
    border: 1px solid rgba(41,128,185,0.2);
    border-radius: 3px;
    font-size: 0.78rem;
    line-height: 1.85;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s;
  }

  .advisor-example:hover {
    background: rgba(41,128,185,0.13);
  }

  .advisor-example-label {
    font-size: 0.65rem;
    color: var(--blue-light);
    letter-spacing: 0.2em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .advisor-example-label::after {
    content: 'クリックで転写';
    font-size: 0.6rem;
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 1px 5px;
    border-radius: 2px;
  }