@charset "UTF-8";

/* =========================
   ページ全体（body）
   ========================= */
body {
  font-family: sans-serif;
  margin: 0;
  padding: 40px 20px;
  text-align: center;
}  

  /* ★ 背景を芝生に */
  body::before{
  content:"";
  position:fixed;
  inset:0;
  background:url("/static/grass_full.png") center / cover no-repeat;
  z-index:-1;
}

/* 中央寄せは container に任せる */
.container{
  max-width: 980px;
  margin: 0 auto;
}

/* =========================
   レイアウト（左：説明 / 右：レース）
========================= */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;

  /* ロゴに合わせた生成り＋半透明 */
  background: rgba(255, 250, 235, 0.82);

  border-radius: 16px;
  padding: 24px;

  box-shadow:
    0 20px 40px rgba(0,0,0,0.12),
    inset 0 0 30px rgba(255, 240, 200, 0.45);
}

/* =========================
   左サイド（説明エリア）
========================= */
.side {
  font-size: 14px;
  line-height: 1.7;
  text-align: left;

  background: rgba(255, 252, 242, 0.88);
  padding: 20px;
  border-radius: 12px;

  box-shadow:
    inset 0 0 12px rgba(255, 230, 190, 0.45),
    0 4px 12px rgba(0,0,0,0.08);
}

/* 説明文エリア 冒頭の説明文だけ中央寄せ */
.side > p:first-of-type {
  text-align: center;
}

/* ゾーン説明などのリストは左寄せ */
.side ol,
.side ul {
  text-align: left;
  padding-left: 1.2em; /* 見やすさ調整 */
}

/* ゾーン名 共通 */
.zone-name {
  font-weight: bold;
}

/* 追い風 */
.zone-name.tailwind {
  color: #f5b800;
  text-shadow: 0 0 6px rgba(255, 210, 80, 0.6);
}

/* 慎重 */
.zone-name.steady {
  color: #3f8f55;
  text-shadow: 0 0 6px rgba(140, 200, 120, 0.5);
}

/* 楽しさ */
.zone-name.playful {
  color: #d84c9f;
  text-shadow: 0 0 6px rgba(255, 130, 190, 0.5);
}

/* 整える */
.zone-name.rest {
  color: #4a78c9;
  text-shadow: 0 0 6px rgba(130, 180, 230, 0.5);
}

/* =========================
   左サイド 中央寄せ
========================= */
.side h2,
.side h3 {
  text-align: center;
}

.side .important {
  text-align: center;
}

/* =========================
   入力フォームエリア
========================= */
.form-area {
  margin-top: 24px;
  padding: 16px;
  border-radius: 12px;

  /* ロゴの金色とつながる淡い光 */
  background: rgba(255, 248, 220, 0.45);

  box-shadow:
    inset 0 0 12px rgba(255, 230, 180, 0.5),
    0 4px 12px rgba(120, 100, 60, 0.15);

  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);

  position: relative;
  z-index: 10;
}

/* フォームの枠をほんのり金色に */
.form-area::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 220, 150, 0.5);
  pointer-events: none;
}

/* =========================
   更新情報
========================= */

.update-display{
  margin:40px auto 0;
  max-width:720px;
  width:100%;
  padding:26px 28px;
  border-radius:24px;
  box-sizing:border-box;
  background:
    rgba(255,252,244,0.86);
  border-left:
    5px solid rgba(180,160,130,0.45);
  box-shadow:
    0 10px 28px rgba(0,0,0,0.08);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  text-align:left;
}

/* タイトル */
.update-title{
  margin:0 0 18px;
  font-size:28px;
  font-weight:700;
  color:#5d4b35;
  letter-spacing:.04em;
}

/* 更新履歴本文 */
.update-info{
  white-space:pre-line;
  line-height:2.1;
  font-size:16px;
  color:#6b5a47;
}

/* 下の補足メッセージ */
.update-message{
  margin-top:20px;
  font-size:14px;
  color:#8a7a68;
  opacity:.9;
}

/* =========================
   レース表示エリア
========================= */
.race {
  margin-top: 24px;
  padding: 16px;
  background: none;
  box-shadow: none;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch; 
}

/* レース中だけ有効 */
.race.running {
  pointer-events: auto;
}

.commentary-box {
  width: 100%;
  max-width: 560px;
  min-height: 44px;
  margin: 0 auto 8px;
  padding: 10px 14px;
  box-sizing: border-box;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff4c2;
  border: 1px solid rgba(255, 221, 102, 0.42);
  box-shadow:
    inset 0 0 12px rgba(255, 221, 102, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.18);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  text-shadow: 0 0 6px rgba(255, 221, 102, 0.45);
}

@media (max-width: 1024px) {
  .race {
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
  }

  .race canvas {
    margin-bottom: 6px;
  }

  .commentary-box {
    display: block;
    visibility: visible;
    flex-shrink: 0;
    width: 100%;
    max-width: 560px;
    min-height: 42px;
    margin: 0 auto 12px;
    padding: 10px 12px;
    position: relative;
    z-index: 2;
    font-size: 15px;
    overflow-wrap: anywhere;
  }
}

/* =========================
   ロゴエリア
========================= */
.logo-area {
  margin: 16px auto 24px;
  text-align: center;
}

.logout-link {
  display: inline-block;
  margin-top: 8px;
  color: #6b5a47;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ロゴ画像本体 */
.main-logo {
  max-width: 520px;   /* ← ここが超重要 */
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;

  /* ほんのり浮かせる */
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.15));
}

/* =========================
   入力フォームまわり
   ========================= */
/* 生年月日・出生地などのラベル */
label {
  display: block;          /* 縦に並べる */
  margin: 8px 0;           /* 上下の余白 */
}

input　{
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(180,160,120,0.5);
  border-radius: 6px;
  padding: 4px 6px;
}

select {
  font-size: 16px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(180,160,120,0.5);
}

/* 「レースを見る」ボタン */
button {
  margin-top: 10px;        /* ボタンの上に余白 */
}

/* 入力フォーム全体を中央に */
.form-area {
  max-width: 520px;
  margin: 0 auto;      /* 中央寄せ */
  text-align: left;    /* 中身は左寄せ */
  position: relative;
  z-index: 10;
}

/* 入力フォームは常に操作可能 */
.form-area,
.form-area * {
  pointer-events: auto;
}

/* =========================
   🔮 ゾーン別 フォームの光
========================= */

/* 共通ベース */
.form-area {
  transition:
    box-shadow 0.6s ease,
    background-color 0.6s ease,
    border-color 0.6s ease;
}

/* 追い風ゾーン */
.form-area.zone-tailwind {
  background: rgba(255, 245, 220, 0.55);
  box-shadow:
    0 0 30px rgba(255, 210, 80, 0.95),
    inset 0 0 12px rgba(255, 240, 200, 0.6);
  outline: 2px solid rgba(255, 200, 80, 0.9);  
}

/* 慎重ゾーン */
.form-area.zone-steady {
  background: rgba(240, 255, 235, 0.55);
  box-shadow:
    0 0 26px rgba(140, 200, 120, 0.9);
    inset 0 0 10px rgba(210, 235, 200, 0.6);
  outline: 2px solid rgba(160, 220, 160, 0.9);
}

/* 楽しさ重視ゾーン */
.form-area.zone-playful {
  background: rgba(255, 235, 245, 0.55);
  box-shadow:
    0 0 26px rgba(255, 130, 190, 0.9)
    inset 0 0 12px rgba(255, 210, 230, 0.6);
  outline: 2px solid rgba(255, 140, 200, 0.9);  
}

/* 整えるゾーン */
.form-area.zone-rest {
  background: rgba(235, 245, 255, 0.55);
  box-shadow:
    0 0 26px rgba(130, 180, 230, 0.9)
    inset 0 0 12px rgba(200, 220, 240, 0.6);
  outline: 2px solid rgba(140, 180, 255, 0.9);
}

/* =========================
   レース表示エリア（canvas）
   ========================= */
  /* ウサギが走るキャンバス */
  canvas {
  width: 100%;
  max-width: 560px;
  height: 180px;   /* ← 属性値と一致させる */
  display: block;
  margin: 0 auto 20px;
}

/* =========================
   電光掲示板 ヘッダー
   ========================= */
.board-header {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 0.15em;
  margin-bottom: 12px;
  padding-bottom: 8px;

  color: #ffdd66;
  text-shadow:
    0 0 6px rgba(255, 221, 102, 0.9),
    0 0 14px rgba(255, 200, 80, 0.6),
    0 0 24px rgba(255, 180, 60, 0.4);

  border-bottom: 1px solid #333;
}

.zone {
  display: inline-block;
  margin: 6px 0 12px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(255,255,255,0.6);
  color: #2f6f3e;
  box-shadow: 0 0 8px rgba(180,220,180,0.4);
}

/* =========================
   結果表示エリア
   ========================= */
.board-row {
  display: grid;
  grid-template-columns:
    1.8em            /* 👑 */
    2.2em            /* 順位 */
    3.2em            /* 種別 */
    3.5em            /* タイム */
    3.5em            /* mood */
    minmax(0, 1fr);  /* メッセージ */

  gap: 0.8em;
  padding: 6px 6px;
  font-size: 15px;
  line-height: 1.4;
  margin: 0 auto 10px;

  border-bottom: 1px dotted #333;
  background: rgba(0,0,0,0.22);
  border-radius: 8px;
}

  /* 👑の見た目も安定させる */
  .crown {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
  }

  /* 文字の発光 */
  .board-row span {
    text-shadow:
      0 0 4px rgba(255, 217, 102, 0.8),
      0 0 8px rgba(255, 217, 102, 0.4);
    color: #ffe9a8;  
  }

  /* 1位だけ強調 */
  .board-row.first {
    background: linear-gradient(
      to right,
      rgba(255,220,90,0.45),
      rgba(0,0,0,0.25)
    );
  }

/* =========================
   レコード行
  ========================= */
  .board-record {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #333;
    color: #ffdd88;
    text-shadow: 0 0 6px rgba(255, 221, 136, 0.8);
  }

  /* 列ごとの揃え */
  .crown,
  .rank,
  .type,
  .time,
  .mood {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }

  .mood {
  text-align: center;
  white-space: nowrap;
  }

  .msg {
  max-width: 22em;        /* ← ここが重要 */  
  white-space: normal;
  word-break: keep-all;
  line-height: 1.6;

  padding-left: 0.8em;
  border-left: 2px solid rgba(255, 220, 120, 0.4);
}

  /* =========================
   電光掲示板 全体
========================= */

/* ===== 電光掲示板（非表示時）===== */
#scoreboard {
  margin: 0 auto;
  padding: 0;

  visibility: hidden;
  height: 0;
  overflow: hidden;
  opacity: 0;

  transition:
    height .4s ease,
    padding .4s ease,
    opacity .4s ease;

  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  background: rgba(0, 0, 0, 0.55);  
}

/* ===== レース後だけ表示 ===== */
#scoreboard.show {
  max-width: 680px;   /* ← 追加 */
  visibility: visible;
  height: auto;
  opacity: 1;

  margin: 16px auto 0;
  padding: 26px 28px;

  background: rgba(0, 0, 0, 0.70);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  border-radius: 14px;

  box-shadow:
    inset 0 0 15px rgba(255,210,90,0.28),
    0 12px 35px rgba(0,0,0,0.45);
}

/* =========================
   ホロスコープ表示制御
========================= */

.chart-area{
  display:none;
  margin-top:30px;
  text-align:center;
}

.chart-area.show{
  display:block;
  animation: chartFade .8s ease;
}

@keyframes chartFade{
  from{
    opacity:0;
    transform:translateY(12px);
  }

  to{
    opacity:1;
    transform:translateY(0);
  }
}

/* =========================
   ホロスコープカード
========================= */

  .chart-card{

    max-width:520px;
    margin:30px auto;

    padding:28px 24px;

    border-radius:24px;

    background:
      rgba(255,252,242,0.88);

    box-shadow:
      0 12px 35px rgba(0,0,0,0.14),
      inset 0 0 20px rgba(255,255,255,0.55);

    text-align:center;
  }

  /* タイトル */
  .chart-title{

    margin:0 0 18px;

    font-size:24px;
    letter-spacing:.08em;

    color:#5f5038;
  }

  /* 説明文 */
  .chart-caption p{
    margin:10px 0;
    margin-top:18px;
    color:#5a4630;
    font-weight:700;
    text-shadow:
      0 1px 0 rgba(255,255,255,0.7);
  }

  /* ホロスコープ */
  #chartCanvas{

    display:block;

    margin:0 auto;

    width:100%;
    max-width:360px;
    height:auto;

    border-radius:50%;

    background:
      radial-gradient(
        circle at center,
        rgba(255,255,255,0.98),
        rgba(245,240,228,0.96)
      );

    box-shadow:
      0 6px 20px rgba(0,0,0,0.08);
  }

  /* ホロスコープ説明 */
    .chart-caption{
    margin-top:22px;
    padding:18px 20px;
    border-radius:18px;
    background:
      rgba(255,255,255,0.45);

    /* Safari対応 */
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    text-align:left;
    line-height:1.9;
    box-shadow:
      inset 0 1px 8px rgba(255,255,255,0.45);
  }

    /* 各行 */
    .chart-caption p{
      display:flex;
      align-items:flex-start;
      gap:10px;
      margin:12px 0;
      color:#5a4630;
      font-size:15px;
      font-weight:500;
      letter-spacing:.03em;
      text-shadow:
        0 1px 0 rgba(255,255,255,0.65);
    }

    /* 「内円」「外円」ラベル */
    .chart-caption strong{
      flex-shrink:0;
      padding:4px 10px;
      border-radius:999px;
      background:
        linear-gradient(
          135deg,
          #c8a96b,
          #e8d2a5
        );

      color:#fff;
      font-size:13px;
      font-weight:700;
      letter-spacing:.08em;
      box-shadow:
        0 2px 6px rgba(0,0,0,0.12);
    }

  /* =========================
    スマホ対応
    ========================= */
@media (max-width: 768px) {

    body {
      padding: 12px; /* 余白を少し詰める */
    }

    .layout {
      grid-template-columns: 1fr; /* 左右 → 縦並び */
      gap: 16px;
      padding: 16px;
    }

    .side {
      order: 2;      /* 説明は下へ */
      font-size: 13px;
    }

    .side summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    margin-bottom: 10px;
  }

  .main {
    order: 1;      /* フォームとレースを上へ */
  }

  canvas {
    width: 100%;
    height: auto;   
  }

  .container {
    max-width: 100%;
  }

  .race {
    padding: 0 4px;
  }

  #scoreboard,
  #scoreboard.show {
    max-width: 100%;
    width: 100%;
    padding: 18px 14px;
    margin: 12px auto;
    box-sizing: border-box;
  }

  .form-area {
    max-width: 100%;
  }

  .board-row {
    grid-template-columns: 1fr;
    gap: 4px;
    font-size: 13px;
  }

  .msg {
    max-width: 100%;
  }
  
}
