/*フォント読み込み*/
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@700;800&display=swap');
:root{
  --cute-font: "M PLUS Rounded 1c", system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* =========================
   ベースレイアウト
   ========================= */

body {
  margin: 0;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  /* アラビアン寄せの幾何学模様 */
  background-image:
    linear-gradient(
      45deg,
      rgba(255, 170, 80, 0.08) 25%,
      transparent 25%
    ),
    linear-gradient(
      -45deg,
      rgba(255, 170, 80, 0.08) 25%,
      transparent 25%
    ),
    linear-gradient(
      45deg,
      transparent 75%,
      rgba(255, 170, 80, 0.08) 75%
    ),
    linear-gradient(
      -45deg,
      transparent 75%,
      rgba(255, 170, 80, 0.08) 75%
    );

  background-size: 96px 96px;   /* 模様を少し大きく */
  background-position: 0 0, 0 48px, 48px -48px, -48px 0;

  overflow-y: scroll;
}


/* =========================
   ヘッダー（ロゴ）
   ========================= */

.global-header {
  height: 100px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  padding: 0;

  background: linear-gradient(
    90deg,
    #c8511a,
    #e76f2e,
    #c8511a
  );

  position: relative; /* ← 追加：::after の基準にする */
  z-index: 10;        /* ← 追加：背景より前に出す */

  box-shadow: none;
}

.global-header::after{
  content: "";
  position: absolute;
  bottom: -40px;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(
    to bottom,
    rgba(255,160,80,0.25),
    rgba(26,20,16,0)
  );
  pointer-events: none;
  z-index: 1;
}

.site-logo {
  height: 100%;
  width: auto;
  max-width: 90%;
  object-fit: contain;
}

/* =========================
   ナビボタン（ヘッダー下）
   ========================= */

.top-nav{
  display: flex;
  justify-content: flex-end; /* ← 右寄せ */
  align-items: center;

  padding: 12px 32px 0;     /* 右上の余白 */
}

.top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.06em;

  height: 60px;
  padding: 0 34px;
  border-radius: 999px;

  background: white;
  color: #d35400;
  border: 2px solid #ff8c42;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.top-btn:hover {
  background: #ff8c42;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(255,140,0,.25);
}

/* =========================
   メインコンテンツ
   ========================= */

#container {
  flex: 1;
  width: 100%;
  overflow-x: clip;   /* 横はみ出しを切る（hiddenでもOK） */
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;

  background: none;
  border-radius: 0;   /* ここも不要なら0でOK */
  box-shadow: none;   /* ← これが横はみ出しの主犯になりやすい */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ガチャカード */

#gacha-area,
#result-area,
#effect-area {
  background: rgba(255, 255, 255, 0.92);
  padding: 50px 60px;
  border-radius: 24px;

  border: 2px solid rgba(255, 140, 0, 0.6);

  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 0 30px rgba(255, 140, 0, 0.4);

  backdrop-filter: blur(6px);
}

#effect-area p{
  font-family: var(--cute-font); /* 見出しと同じ系統 */
  font-size: 28px;               /* ← ここで大きさ調整 */
  font-weight: 800;
  letter-spacing: 0.12em;

  margin-top: 14px;
  color: #ff8c42;
}

/* =========================
   ボタン
   ========================= */

button {
  font-size: 18px;
  padding: 14px 36px;
  border-radius: 8px;
  border: none;
  cursor: pointer;

  background: linear-gradient(90deg, #ff7a00, #ffb347);
  color: white;
  font-weight: 600;
  letter-spacing: 1px;

  box-shadow: 0 6px 20px rgba(255, 140, 0, 0.5);
  transition: 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 140, 0, 0.6);
}

/* =========================
   演出
   ========================= */

.hidden {
  display: none;
}

.spinner {
  font-size: 50px;
  animation: spin 0.6s infinite alternate;
  color: #ffb347;
}

@keyframes spin {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 1; }
}

/* =========================
   曲一覧画面
   ========================= */

.page {
  max-width: 1100px;
  margin: 40px auto 80px;
  padding: 32px 36px;

  /* ↓ ここが重要 */
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;

  /* 枠＋浮き感 */
  border: 2px solid rgba(255, 150, 80, 0.35);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 200, 140, 0.25) inset;

  position: relative; /* これが無いと疑似要素の位置が安定しない */
}

/* 菱形（宝石） */
.page::after{
  content: "";
  position: absolute;
  top: 42px;           /* ← marginの量で微調整（最初はこれでOK） */
  left: calc(50% - 7px);
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  background: rgba(255,150,70,0.95);
  border-radius: 3px;
  box-shadow: 0 6px 12px rgba(255,140,0,0.22);
}


/* テーブル */

.song-table {
  width: 100%;
  table-layout: fixed; /* 列幅を均等に */
  border-collapse: collapse;
  margin-top: 10px;
}

.song-table th,
.song-table td {
  border-bottom: 1px solid #eee;
  padding: 10px;
  text-align: left;
  white-space: nowrap;
}

.song-table th {
  background: #f3f3f3;
  font-weight: 700;
}

.song-table tr:hover td {
  background: #fafafa;
}

.song-table .empty {
  text-align: center;
  color: #777;
  padding: 18px 10px;
}

.song-table th:nth-child(1),
.song-table td:nth-child(1) {
  width: 30%;
}
.song-table th:nth-child(2),
.song-table td:nth-child(2) {
  width: 30%;
}
.song-table th:nth-child(3),
.song-table td:nth-child(3) {
  width: 10%;
}
.song-table th:nth-child(4),
.song-table td:nth-child(4) {
  width: 15%;
}
.song-table th:nth-child(5),
.song-table td:nth-child(5) {
  width: 15%;
}

/* songs表：centerクラスは左寄せ指定より優先して中央寄せにする */
.song-table th.center,
.song-table td.center {
  text-align: center;
}

.center {
  text-align: center;
}

/* songs: 検索行を「4入力 + 操作列」に */
.search-row{
  display: grid;
  /* 固定pxをやめて、狭い画面では縮むようにする */
  grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 200px) minmax(180px, 260px) auto;
  gap: 10px;
  align-items: end;
}

/* フィールド */
.search-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label{
  font-size: 12px;
  color: #555;
}

/* 入力サイズ感を統一 */
.search-field input,
.search-field select{
  height: 34px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
}

/* 操作列は横並び＆小さめ */
.search-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}

/* songs内の btn サイズを入力と揃える */
.search-actions .btn{
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* =========================
   スマホ対応
   ========================= */

@media (max-width: 760px){
  .search-row{
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .search-actions{
    justify-content: flex-start;
  }
  .search-actions .btn{
    width: auto;
  }
}

/* =========================
   見出し：かわいく大きく（共通）
   ========================= */

/* 「選曲ガチャ」(h1) と、曲一覧ページの見出し(h1/h2)を同じフォントに */
#gacha-area h1,
.page h1,
.page h2 {
  font-family: var(--cute-font);
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* 「選曲ガチャ」をもっと大きく */
#gacha-area h1{
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.1;
  margin: 0 0 18px;
  text-shadow:
    0 2px 0 rgba(0,0,0,.10),
    0 10px 22px rgba(0,0,0,.12);
}

/* =========================
   ガチャ結果：曲名をデデーン！
   ========================= */

#song-title{
  font-family: var(--cute-font);
  font-weight: 800;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.05;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
  text-align: center;

  /* 結果感：縁取りっぽく + 影 */
  text-shadow:
    -2px -2px 0 rgba(255,255,255,.95),
     2px -2px 0 rgba(255,255,255,.95),
    -2px  2px 0 rgba(255,255,255,.95),
     2px  2px 0 rgba(255,255,255,.95),
     0   14px 26px rgba(0,0,0,.18);
}

#song-count{
  font-family: var(--cute-font);
  font-weight: 800;
  font-size: 22px;
  margin: 0 0 10px;
  color: #666;
}

/* ===== 20回以上：レア演出 =====
   result-area に rare クラスが付いたら派手にする
*/
#result-area.rare #song-title{
  font-size: clamp(46px, 5.2vw, 78px);
  text-shadow:
    -2px -2px 0 rgba(255,255,255,.95),
     2px -2px 0 rgba(255,255,255,.95),
    -2px  2px 0 rgba(255,255,255,.95),
     2px  2px 0 rgba(255,255,255,.95),
     0   18px 34px rgba(0,0,0,.22);
  animation: tadaIn .45s ease-out both;
}

#result-area.rare #song-count{
  font-size: 30px;
  font-weight: 900;
  color: #f08300;
  text-shadow: 0 0 10px rgba(255, 100, 170, 0.55);
}

/* 補助情報も少し大きく（好み） */
#song-info{
  font-size: 18px;
  margin: 0 0 18px;
}

#result-area:not(.hidden) #song-title{
  animation: tadaIn .45s ease-out both;
}
@keyframes tadaIn{
  0%{ transform: scale(.92); opacity: 0; }
  60%{ transform: scale(1.06); opacity: 1; }
  100%{ transform: scale(1); }
}

/* =========================
   曲一覧の曲名、歌手名を省略して表示
   ========================= */
.song-table-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
