@import url('https://fonts.googleapis.com/css2?family=Mochiy+Pop+One&family=Kosugi+Maru&display=swap');

:root {
    --bg1: #1f1a3a;
    --bg2: #35296b;
    --panel: #fffaf2;
    --accent: #7b4fd1;
    --accent-dark: #5c37a8;
    --text: #4a3826;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; }
body {
    font-family: 'Kosugi Maru', sans-serif;
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 50% 0%, var(--bg2), var(--bg1));
    color: var(--text);
    display: flex;
    justify-content: center;
    padding: 10px;
    touch-action: manipulation;
}
.app { width: 100%; max-width: 720px; }
.hidden { display: none !important; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 12px; }
.brand { font-family: 'Mochiy Pop One', cursive; color: #f1e9ff; font-size: 1.2rem; text-shadow: 2px 2px 0 rgba(0,0,0,0.4); }
.home-link { color: #d9c4ff; font-size: 0.8rem; text-decoration: none; border: 1px solid #d9c4ff55; border-radius: 20px; padding: 5px 12px; white-space: nowrap; }
.pt-badge { background: var(--panel); border-radius: 14px; padding: 6px 14px; font-weight: bold; color: #d18a00; box-shadow: 0 4px 0 rgba(0,0,0,0.15); }

.panel {
    background: var(--panel); border-radius: 18px; padding: 16px;
    box-shadow: 0 6px 0 rgba(0,0,0,0.15); margin-bottom: 12px;
}
.panel h2 { margin: 0 0 10px; font-family: 'Mochiy Pop One', cursive; color: var(--accent-dark); font-size: 1.15rem; }
.panel p.desc { font-size: 0.85rem; color: #6b5a4a; line-height: 1.6; margin: 0 0 14px; }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card {
    background: #fff; border: none; border-radius: 16px; padding: 16px 10px;
    box-shadow: 0 4px 0 #d9c4ff; cursor: pointer; text-align: center; font-family: 'Kosugi Maru', sans-serif;
}
.mode-card:active { transform: translateY(3px); box-shadow: none; }
.mode-card .m-emoji { font-size: 1.8rem; display: block; margin-bottom: 4px; }
/*
 * V-4：display:block が無かったため、タイトルと説明が1行に続いて
 * 「マラソンひとりで延々プレイ」のように表示されていた。
 * 説明文の色も 4.15:1 だったので本文と同じ #6b5a4a（7.0:1）にする。
 */
.mode-card .m-title { display: block; font-weight: bold; color: var(--accent-dark); font-size: 0.95rem; }
.mode-card .m-desc { display: block; font-size: 0.74rem; color: #6b5a4a; margin-top: 3px; line-height: 1.5; }

.btn {
    border: none; border-radius: 14px; padding: 11px 14px;
    font-family: 'Kosugi Maru', sans-serif; font-size: 0.85rem; font-weight: bold; cursor: pointer;
}
.btn-sub { background: #fff; color: var(--accent-dark); box-shadow: 0 4px 0 #d9c4ff; }
.btn-main { background: #ffb703; color: #5c3d00; box-shadow: 0 4px 0 #c98f00; }
.btn:active { transform: translateY(3px); box-shadow: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.level-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cpu-level-btn { background: var(--accent); color: #fff; border: none; border-radius: 12px; padding: 14px 4px; font-weight: bold; box-shadow: 0 4px 0 var(--accent-dark); cursor: pointer; font-family: 'Kosugi Maru', sans-serif; }
.cpu-level-btn:active { transform: translateY(3px); box-shadow: none; }
.cpu-level-btn .lv-label { display: block; font-size: 0.7rem; margin-top: 2px; opacity: 0.85; }

form.join-form { display: flex; flex-direction: column; gap: 10px; }
form.join-form label { font-size: 0.8rem; color: #6b5a4a; display: block; margin-bottom: 3px; }
form.join-form input, form.join-form select {
    width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid #ddd; font-size: 0.9rem;
    font-family: 'Kosugi Maru', sans-serif;
}
.setup-msg { font-size: 0.82rem; color: #c0392b; min-height: 1.2em; }

/* ---- ゲーム画面共通 ---- */
.game-stage { background: var(--panel); border-radius: 18px; padding: 12px; box-shadow: 0 6px 0 rgba(0,0,0,0.15); }
.stage-row { display: flex; gap: 12px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.board-frame { position: relative; background: #201541; border-radius: 12px; padding: 8px; box-shadow: 0 6px 0 rgba(0,0,0,0.25); }
canvas.board-canvas { display: block; border-radius: 6px; }

.fx-layer {
    position: absolute; top: 8px; left: 8px; right: 8px; bottom: 8px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; overflow: visible; z-index: 5;
}
/* ------------------------------------------------------------------
 * 対戦中メニュー（Qキー）
 * 盤面を隠さないよう半透明にし、パネルだけを中央に出す。
 * ---------------------------------------------------------------- */
.pause-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 12, 45, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.pause-overlay.hidden { display: none; }
.pause-panel {
    background: #fffdf7;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 10px 0 rgba(0,0,0,0.25);
    text-align: center;
    min-width: 220px;
}
.pause-panel h3 {
    margin: 0 0 14px;
    font-size: 1.1rem;
    color: var(--accent-dark, #5a3fa0);
}
.pause-panel .btn { display: block; width: 100%; margin: 8px 0; }
.pause-hint { margin: 12px 0 0; font-size: 0.72rem; color: #7a6a90; }
.pause-hint kbd {
    background: #eee6ff; border-radius: 4px; padding: 1px 5px; font-size: 0.72rem;
}

/* ------------------------------------------------------------------
 * おじゃま予告（ぷよぷよテトリス風）
 *
 * 盤面の上に横一列でおじゃまアイコンを並べる。
 * ぷよテトと同じく、1個=1ライン / 大=6ライン / 岩=30ライン …と
 * 段階的に大きいアイコンへ繰り上げることで、少ない個数でも
 * 「どれくらい降ってくるか」が一目で分かるようにしている。
 * ---------------------------------------------------------------- */
.garbage-icons {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 22px;              /* 空でも高さを確保してレイアウトを動かさない */
    margin: 0 0 4px;
    padding: 0 2px;
    pointer-events: none;
}
.garbage-icons .gi {
    display: block;
    flex: none;
    border-radius: 50%;
    background: #8d8d99;       /* おじゃまブロックと同じ色 */
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.28), 0 1px 1px rgba(0,0,0,0.35);
}
/*
 * V-1：実際に届く 1〜10 ラインの範囲に目盛りを切り直す。
 *
 * 1回のせり上がりは 10 行で頭打ち（GARBAGE_PER_LOCK_MAX）なので、
 * 30 と 180 のアイコンは実戦でほとんど出ない。
 * 以前はその範囲に「同じ色・同じ形で大きさだけ違う灰色の円」が
 * 2つしか無く、9px と 15px の差だけで6倍の危険度を表していた。
 *
 * 1 / 3 / 6 / 10 の4段にし、段が上がるごとに
 * 大きさ・形・色の3つが同時に変わるようにしてある。
 * どれか1つの手がかりが使えなくても区別できる。
 */
.garbage-icons .gi-s { width: 9px;  height: 9px;  }   /* 1ライン：小・灰・円 */
.garbage-icons .gi-m { width: 13px; height: 13px; }   /* 3ライン：中・灰・円 */
.garbage-icons .gi-l {                                 /* 6ライン：黄橙・角丸四角 */
    width: 16px; height: 16px;
    border-radius: 4px;
    background: #e8a13a;
}
.garbage-icons .gi-x {                                 /* 10ライン：赤・角あり */
    width: 18px; height: 18px;
    border-radius: 3px;
    background: #d64b45;
    transform: rotate(45deg);
}
.garbage-icons .gi-r {                                 /* 30ライン（岩） */
    width: 19px; height: 19px;
    border-radius: 5px;
    background: #5c5768;
    transform: rotate(45deg);
}

/*
 * V-4：次にミノを置いたときにせり上がる行数。
 * 「いま何行溜まっているか」ではなく「次の1手で何行落ちてくるか」を示す。
 */
.garbage-icons .gi-drop {
    flex: none;
    font-size: 0.72rem;
    font-weight: bold;
    line-height: 1;
    color: #ffd9d9;
    background: #b3332e;
    border-radius: 6px;
    padding: 3px 5px;
    margin-right: 2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.35);
}
.garbage-icons .gi-star {                              /* 180ライン（星） */
    width: 20px; height: 20px;
    border-radius: 0;
    background: #ffd54f;
    box-shadow: none;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/*
 * 大量に溜まっているときは点滅させて警告する。
 * filter だけを動かすアニメーションにしてあるので、
 * （バックグラウンドタブなどで）アニメーションが進まなくても
 * アイコンの大きさや位置は正常なまま表示される。
 */
.garbage-icons.danger .gi { animation: giAlert 0.55s ease-in-out infinite; }

@keyframes giAlert {
    0%, 100% { filter: none; }
    50%      { filter: brightness(1.45) drop-shadow(0 0 4px rgba(255,80,80,0.9)); }
}

/* オンライン対戦：盤面とアイコン列を縦に積むためのラッパ */
.board-col { display: flex; flex-direction: column; }

@media (max-width: 520px) {
    .garbage-icons { height: 16px; gap: 2px; }
    .garbage-icons .gi-s { width: 7px;  height: 7px;  }
    .garbage-icons .gi-l { width: 12px; height: 12px; }
    .garbage-icons .gi-r { width: 14px; height: 14px; }
    .garbage-icons .gi-star { width: 15px; height: 15px; }
}

.clear-label {
    text-align: center; font-family: 'Mochiy Pop One', cursive;
    text-shadow: 0 0 10px currentColor, 2px 2px 0 rgba(0,0,0,0.55);
    animation: clearLabelPop 1.3s ease forwards;
    white-space: nowrap;
}
.clear-label .main-text { display: block; font-size: 1.05rem; }
.clear-label .sub-text { display: block; font-size: 0.6rem; margin-top: 4px; letter-spacing: 0.5px; }
/* V-5：その消去で入ったポイント。結果画面の内訳（P-3）と同じ言葉を使う。 */
.clear-label .pt-text { display: block; font-size: 0.72rem; margin-top: 3px; color: #ffd76b; text-shadow: 0 0 8px rgba(255,183,3,0.8), 1px 1px 0 rgba(0,0,0,0.6); }
.clear-label.tier-1 { color: #9be7ff; }
.clear-label.tier-2 { color: #ffe066; }
.clear-label.tier-3 { color: #ff6bd6; }
.clear-label.tier-3 .main-text { font-size: 1.3rem; }
/* ------------------------------------------------------------------
 * U-3：開始のカウントダウン（3・2・1・スタート！）
 * 盤面の演出レイヤーの上に出す。
 * ---------------------------------------------------------------- */
/* 盤面の中ではなく画面の中央に出す（対戦では2つの盤面の間） */
.countdown-screen {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none; z-index: 45;
}
.countdown-label {
    display: inline-block;
    font-family: 'Mochiy Pop One', cursive; font-size: 3.2rem; color: #fff;
    text-shadow: 0 0 18px #7b4fd1, 3px 3px 0 rgba(0,0,0,0.55);
    /* クリーム色のパネルの上でも読めるように、濃い下地を敷く */
    background: rgba(32, 21, 65, 0.85);
    border-radius: 20px;
    padding: 8px 36px;
    box-shadow: 0 6px 0 rgba(0,0,0,0.25);
    pointer-events: none;
    animation: countdownPop 0.85s ease forwards;
}
.countdown-label.go { font-size: 2.2rem; color: #ffd76b; }
@keyframes countdownPop {
    0%   { transform: scale(1.7); opacity: 0; }
    20%  { transform: scale(1);   opacity: 1; }
    80%  { transform: scale(1);   opacity: 1; }
    100% { transform: scale(0.8); opacity: 0; }
}

@keyframes clearLabelPop {
    0% { transform: scale(0.3) rotate(-8deg); opacity: 0; }
    15% { transform: scale(1.3) rotate(3deg); opacity: 1; }
    30% { transform: scale(1) rotate(0deg); opacity: 1; }
    75% { transform: scale(1) rotate(0deg); opacity: 1; }
    100% { transform: scale(0.92) translateY(-14px); opacity: 0; }
}
.side-panel { display: flex; flex-direction: column; gap: 8px; min-width: 78px; }
.mini-box { background: #201541; border-radius: 10px; padding: 4px; text-align: center; transition: opacity 0.15s; }
.mini-box .mini-label { font-size: 0.65rem; color: #cbb9f0; margin-bottom: 2px; }
.mini-box.hold-locked { opacity: 0.4; }
.mini-box.hold-locked .mini-label::after { content: ' 🔒'; }
canvas.mini-canvas { display: block; margin: 0 auto; }

.stats-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; font-size: 0.8rem; }
.stat-chip { background: #f7f2ff; border-radius: 10px; padding: 6px 10px; }
.stat-chip b { color: var(--accent-dark); }

.battle-board { flex: 1; min-width: 140px; max-width: 220px; }
/*
 * V-1：対戦画面のプレイヤー名。
 * 以前は #f1e9ff（紫背景に置く前提の白系）で、実際にはクリーム色の
 * パネル #fffaf2 の上に乗っていたためコントラスト比 1.13:1 ＝ ほぼ不可視だった。
 * 本文と同じ濃い色にして 10.1:1 にする。
 */
.battle-label { text-align: center; font-size: 0.85rem; font-weight: bold; color: var(--text); margin-bottom: 4px; }

.opponents-list { list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.8rem; }
.opponents-list li { padding: 4px 8px; background: #f7f2ff; border-radius: 8px; margin-bottom: 4px; }
.opponents-list li.topped { opacity: 0.5; text-decoration: line-through; }

.howto-mini { background: rgba(255,255,255,0.9); border-radius: 14px; padding: 8px 12px; margin-top: 10px; font-size: 0.78rem; color: #5a4a3a; }
.howto-mini summary { cursor: pointer; font-weight: bold; }
.howto-mini ul { margin: 6px 0 0; padding-left: 18px; }

/* ---- 常時表示の操作ガイド ---- */
.key-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.key-legend .legend-owner { font-size: 0.72rem; color: #8a7a68; align-self: center; margin-right: 2px; }
.key-chip {
    background: #f7f2ff; border-radius: 8px; padding: 4px 8px; font-size: 0.72rem; color: var(--accent-dark);
    white-space: nowrap;
}
.key-chip kbd {
    background: var(--accent); color: #fff; border-radius: 4px; padding: 1px 5px;
    font-family: 'Kosugi Maru', sans-serif; font-size: 0.7rem; margin-right: 3px;
}

/* ---- オーバーレイ共通 ---- */
.overlay {
    position: fixed; inset: 0; background: rgba(20, 12, 45, 0.72);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 50; padding: 16px;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.overlay-card {
    background: var(--panel); border-radius: 20px; padding: 22px 20px;
    max-width: 380px; width: 100%; max-height: 88vh; overflow-y: auto;
    text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,0.2);
}
.overlay-card h2 { margin: 0 0 8px; font-family: 'Mochiy Pop One', cursive; font-size: 1.3rem; color: var(--accent-dark); }
.overlay-card p { font-size: 0.9rem; line-height: 1.6; }
.pt-earned { font-size: 1.6rem; font-weight: bold; color: #d18a00; margin: 10px 0; }
/* P-3：何で何ポイント入ったかの内訳 */
.pt-breakdown { list-style: none; padding: 0; margin: 4px 0 2px; font-size: 0.82rem; text-align: left; }
.pt-breakdown li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 10px; border-bottom: 1px solid #efe7db; }
.pt-breakdown li:last-child { border-bottom: none; }
.pt-breakdown .b-label { color: #6b5a4a; }
.pt-breakdown .b-pt { font-weight: bold; color: #d18a00; white-space: nowrap; }
.pt-records { font-size: 0.78rem; color: #6b5a4a; margin: 6px 0 0; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab-btn { flex: 1; border: none; border-radius: 12px 12px 0 0; padding: 9px; background: #eee; color: #888; font-weight: bold; cursor: pointer; font-family: 'Kosugi Maru', sans-serif; }
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-panel.hidden { display: none; }
.gacha-cost { font-size: 0.85rem; margin: 4px 0 10px; color: #6b5a4a; }
.gacha-btn-row { display: flex; gap: 8px; margin-bottom: 6px; }
.prob-toggle { background: none; border: none; color: var(--accent-dark); font-size: 0.78rem; text-decoration: underline; cursor: pointer; margin: 6px 0; }
.prob-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; margin-bottom: 8px; }
.prob-table th, .prob-table td { border-bottom: 1px solid #eee; padding: 4px 6px; text-align: left; }
.rarity-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

.gacha-result { margin-top: 10px; }
.gacha-card-reveal { border-radius: 14px; padding: 14px; margin-bottom: 8px; border: 2px solid #eee; }
.gacha-card-reveal .g-emoji { font-size: 2.1rem; }
.gacha-card-reveal .g-name { font-weight: bold; font-size: 1rem; margin: 4px 0 2px; }
.gacha-card-reveal .g-rarity { font-size: 0.8rem; margin-bottom: 6px; font-weight: bold; }
.gacha-card-reveal .g-fact { font-size: 0.8rem; background: #f7f2ff; border-radius: 8px; padding: 8px; margin-top: 6px; color: #4a3868; text-align: left; }

.collection-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.coll-item { background: #f7f2ff; border-radius: 10px; padding: 8px 4px; font-size: 0.66rem; text-align: center; line-height: 1.3; }
.coll-item.locked { background: #eee; color: #999; }
.coll-item .c-emoji { font-size: 1.4rem; display: block; }
.coll-item .c-count { font-size: 0.62rem; color: #888; }
.close-btn { margin-top: 14px; }

@media (max-width: 480px) {
    .mode-grid { grid-template-columns: 1fr; }
    .level-grid { grid-template-columns: repeat(5, 1fr); }
}

/* =========================================
   対戦画面レイアウト
   左から HOLD → 盤面 → NEXT → HOLD → 盤面 → NEXT と横に並べる。
   どれも普通の横並び（flex）で置き、重ねない。
   ========================================= */

.battle-stage {
    width: 100%;
    box-sizing: border-box;
}

/* 1P・2P全体 */
.battle-players {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;          /* 画面が狭いときは2Pが下に回る（重ならない） */
    width: 100%;
    box-sizing: border-box;
}

/* 1人分：HOLD・盤面・NEXT を横に並べる */
.battle-player {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    flex: 0 0 auto;
    box-sizing: border-box;
}

/*
 * 盤面（幅は盤面の枠に合わせる）
 * スコア欄や CPU の表示が長くても列が広がらないよう、
 * 幅の基準は盤面の枠だけにする（スコア欄は折り返す）。
 */
.battle-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: min-content;
}
.battle-main .garbage-icons,
.battle-main .ai-status {
    align-self: stretch;
    contain: inline-size;
    overflow: hidden;
}
.battle-main .stats-row {
    justify-content: center;
}
.battle-main .battle-label {
    margin-bottom: 6px;
}

/* HOLD / NEXT */
.battle-mini-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}
.battle-mini-area .mini-box {
    flex-shrink: 0;
}

/*
 * V-3：CPUがいま何を組んでいるかの表示。
 * 盤面の情報量を邪魔しないよう、小さく1行に収める。
 */
/*
 * V-1：CPUが何を組んでいるかの表示。
 * 以前は #cbb9f0・10.9px でコントラスト比 1.72:1 ＝ ほぼ読めなかった。
 */
.ai-status {
    min-height: 1.1em;
    margin: 0 0 4px;
    padding: 0 2px;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--accent-dark);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}


/* =========================================
   第7回 G-1/G-3/G-4/G-5/G-6・U-4 の追加分
   ========================================= */

/* --- U-4：練習モードのお手本 --- */
.guide-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 0.82rem; color: var(--text); }
.guide-bar label { font-weight: bold; color: var(--accent-dark); }
.guide-bar select { padding: 6px 8px; border-radius: 10px; border: 1px solid #ddd; font-family: 'Kosugi Maru', sans-serif; font-size: 0.82rem; max-width: 220px; }
.guide-msg { font-size: 0.82rem; color: #6b5a4a; }
.guide-msg.done { color: #2e7d32; font-weight: bold; }
.guide-hint { font-size: 0.72rem; color: #6b5a4a; margin: 4px 0 0; }
/* 第8回 O-1/O-4/O-7/O-9/O-11：お手本の設定・条件・残りマス・注意 */
.guide-opts { margin-top: 6px; }
.guide-opts label { font-weight: normal; color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.guide-opts.hidden { display: none; }
.guide-left { font-size: 0.78rem; font-weight: bold; color: var(--accent-dark); background: #f7f2ff; border-radius: 8px; padding: 3px 8px; }
.guide-left:empty { display: none; }
.guide-cond { font-size: 0.76rem; color: var(--text); margin: 6px 0 0; line-height: 1.6; }
.guide-cond:empty { display: none; }
.guide-msg.warn { color: #b3261e; font-weight: bold; }

/* --- G-4：ガチャ画面の残高とシリーズ --- */
.gacha-head { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.gacha-series { background: #f7f2ff; border-radius: 12px; padding: 10px 12px; font-size: 0.82rem; color: var(--text); margin-bottom: 8px; text-align: left; }
.gacha-series b { display: block; color: var(--accent-dark); }
.gacha-series .series-progress { display: inline-block; font-weight: bold; color: #d18a00; margin-top: 4px; }
.gacha-series .series-reward { display: block; font-size: 0.74rem; color: #6b5a4a; margin-top: 2px; }
.btn.btn-short { background: #e7ddc9; color: #8a7a68; box-shadow: 0 4px 0 #cbbfa8; }
.gacha-short { color: #c0392b; font-size: 0.85rem; }

/* --- G-5：1枚ずつめくる／レアリティで演出を変える --- */
.gacha-card-reveal { transition: transform 0.35s ease, opacity 0.35s ease; }
.gacha-card-reveal.pending { transform: scale(0.6) rotate(-6deg); opacity: 0; }
.gacha-card-reveal.r4 { box-shadow: 0 0 14px rgba(155,63,213,0.45); }
.gacha-card-reveal.r5 { box-shadow: 0 0 20px rgba(224,163,0,0.65); animation: urGlow 1.6s ease-in-out infinite; }
@keyframes urGlow {
    0%, 100% { box-shadow: 0 0 14px rgba(224,163,0,0.45); }
    50%      { box-shadow: 0 0 26px rgba(224,163,0,0.9); }
}
.gacha-card-reveal .g-unlock { font-size: 0.76rem; color: #2e7d32; background: #eaf6ea; border-radius: 8px; padding: 6px 8px; margin-top: 6px; }
.series-clear { background: #fff4d6; border: 2px solid #ffb703; border-radius: 12px; padding: 12px; margin-bottom: 10px; font-size: 0.85rem; color: #5c3d00; }

/* --- G-6：図鑑 --- */
.coll-summary { font-size: 0.8rem; color: var(--text); font-weight: bold; margin: 4px 0 8px; }
.coll-series { text-align: left; font-size: 0.8rem; font-weight: bold; color: var(--accent-dark); margin: 12px 0 4px; display: flex; justify-content: space-between; }
.coll-series.done { color: #2e7d32; }
.coll-series span { font-weight: normal; color: #6b5a4a; }
.coll-item { cursor: default; }
.coll-item:not(.locked) { cursor: pointer; }
.coll-item:not(.locked):active { transform: translateY(2px); }
.collection-detail { background: #fffaf2; border: 2px solid var(--accent); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.collection-detail .cd-emoji { font-size: 2.4rem; }
.collection-detail .cd-name { font-weight: bold; font-size: 1rem; margin: 4px 0 2px; }
.collection-detail .cd-rarity { font-size: 0.8rem; font-weight: bold; margin-bottom: 6px; }
.collection-detail .cd-fact { font-size: 0.82rem; text-align: left; background: #f7f2ff; border-radius: 8px; padding: 8px; color: #4a3868; }
.collection-detail .btn { margin: 6px 4px 0; }

/* --- きせかえ --- */
.skin-row { display: flex; flex-wrap: wrap; gap: 6px; }
.skin-chip { flex: 1 1 88px; background: #fff; border: 2px solid #e6dff5; border-radius: 12px; padding: 8px 4px; font-size: 0.72rem; color: var(--text); font-family: 'Kosugi Maru', sans-serif; cursor: pointer; }
.skin-chip .s-emoji { display: block; font-size: 1.3rem; margin-bottom: 2px; }
.skin-chip.on { border-color: var(--accent); background: #f3ecff; font-weight: bold; }
.skin-chip.locked { color: #aaa; background: #f0f0f0; cursor: default; }

/* --- 盤面の枠（きせかえ） --- */
body[data-frame="wood"]  .board-frame { background: #6b4b2a; box-shadow: 0 6px 0 #4a3420; }
body[data-frame="ice"]   .board-frame { background: #2a6b80; box-shadow: 0 6px 0 #1b4b5c; }
body[data-frame="space"] .board-frame { background: #10133a; box-shadow: 0 6px 0 #05061f; }
body[data-frame="candy"] .board-frame { background: #b8437f; box-shadow: 0 6px 0 #8a2f5f; }
