@charset "utf-8";
/* ====================================================================
   フォロワーさんバトル用CSS（ポケモンのバトル画面っぽくするゾ）
   ライトモード用。暗色は ikisugi_darkmode.css 側で上書きする
==================================================================== */

.pb-select,
.pb-battle {
    margin: 20px 0 30px;
}

/* ============ 1. 選出画面 ============ */
.pb-select-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 18px;
}
.pb-select-col { flex: 1; min-width: 0; }

.pb-select-label {
    display: block;
    font-weight: bold;
    font-size: 0.9em;
    color: #004488;
    margin-bottom: 4px;
}
.pb-select-box {
    width: 100%;
    padding: 9px 12px;
    font-size: 1em;
    font-family: inherit;
    font-weight: bold;
    color: #333;
    background-color: #fff;
    border: 2px solid #004488;
    border-radius: 6px;
    cursor: pointer;
}
.pb-select-box:focus-visible {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}
.pb-select-vs {
    flex: none;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 1.5em;
    color: #e3350d;
    padding-bottom: 7px;
    letter-spacing: 0.05em;
}

/* ---- ステータスカード ---- */
.pb-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.pb-card {
    background-color: #fff;
    border: 2px solid #ccddee;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.pb-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.pb-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ccddee;
    flex: none;
    background-color: #eef3f8;
}
.pb-card-name {
    font-weight: bold;
    font-size: 1.05em;
    line-height: 1.3;
    word-break: break-word;
}
.pb-card-id {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.75em;
    color: #888;
}

/* 画像が無い/読めない時の代替アバター（名前の頭文字） */
.pb-noicon {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    flex: none;
    line-height: 1;
    user-select: none;
}
.pb-card-icon.pb-noicon,
.pb-noicon.pb-card-icon { width: 48px; height: 48px; font-size: 1.25em; }
.pb-sprite-foe  .pb-noicon { width: 92px;  height: 92px;  font-size: 2.4em; border: 3px solid #fff; }
.pb-sprite-ally .pb-noicon { width: 118px; height: 118px; font-size: 3em;   border: 4px solid #fff; }

/* タイプのバッジ */
.pb-type {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.78em;
    font-weight: bold;
    color: #fff;
    letter-spacing: 0.08em;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}
.pb-type-ninki   { background-color: #f8d030; color: #4a3a00; text-shadow: none; }
.pb-type-koryu   { background-color: #6890f0; }
.pb-type-hasshin { background-color: #f08030; }
.pb-type-shushu  { background-color: #78c850; }

/* 種族値バー */
.pb-stats { margin-top: 10px; }
.pb-stat {
    display: grid;
    grid-template-columns: 62px 1fr 32px;
    gap: 7px;
    align-items: center;
    margin-bottom: 3px;
    font-size: 0.78em;
}
.pb-stat-name { font-weight: bold; color: #555; }
.pb-stat-bar {
    height: 9px;
    background-color: #e8eef4;
    border-radius: 5px;
    overflow: hidden;
}
.pb-stat-bar i {
    display: block;
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #4dc3ff, #004488);
    transition: width .5s ease;
}
.pb-stat-num {
    font-family: Consolas, "Courier New", monospace;
    text-align: right;
    font-weight: bold;
    color: #333;
}
.pb-total {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #ccddee;
    font-size: 0.8em;
    color: #666;
}
.pb-total b { color: #004488; font-size: 1.15em; }
.pb-raw {
    margin-top: 6px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.7em;
    color: #999;
    line-height: 1.7;
}

/* ---- たたかうボタン ---- */
.pb-start {
    display: block;
    width: 100%;
    max-width: 340px;
    margin: 22px auto 0;
    padding: 14px;
    font-size: 1.15em;
    font-weight: bold;
    letter-spacing: 0.12em;
    color: #fff;
    background-color: #e3350d;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 0 #a32409;
    cursor: pointer;
    transition: transform .1s ease, background-color .15s ease;
}
.pb-start:hover { background-color: #f04a22; }
.pb-start:active { transform: translateY(4px); box-shadow: 0 0 0 #a32409; }
.pb-start:focus-visible { outline: 3px solid #ffcc00; outline-offset: 3px; }
.pb-start:disabled {
    background-color: #bbb;
    box-shadow: 0 4px 0 #888;
    cursor: not-allowed;
    transform: none;
}

/* ============ 2. バトルフィールド ============ */
.pb-field {
    position: relative;
    height: 300px;
    border: 3px solid #333;
    border-radius: 8px 8px 0 0;
    border-bottom: none;
    overflow: hidden;
    background:
        linear-gradient(180deg, #7ec8f0 0%, #b8e4f5 52%, #a8d878 52%, #78b850 100%);
}
.pb-slot { position: absolute; }
.pb-slot-foe  { top: 14px;    right: 16px; text-align: center; }
.pb-slot-ally { bottom: 12px; left: 16px;  text-align: center; }

/* 地面の楕円 */
.pb-sprite {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.pb-sprite::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(60,110,40,0.28);
    border-radius: 50%;
}
.pb-sprite-foe::after  { width: 106px; height: 22px; }
.pb-sprite-ally::after { width: 140px; height: 28px; }

.pb-sprite img {
    display: block;
    border-radius: 50%;
    object-fit: cover;
    background-color: rgba(255,255,255,0.7);
    image-rendering: auto;
}
.pb-sprite-foe img  { width: 92px;  height: 92px;  border: 3px solid #fff; }
.pb-sprite-ally img { width: 118px; height: 118px; border: 4px solid #fff; }

/* ダメージを受けた時の点滅 */
/* ダメージを受けた時の横揺れ（着弾の瞬間） */
@keyframes pbHit {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-7px); }
    40%     { transform: translateX(7px); }
    60%     { transform: translateX(-5px); }
    80%     { transform: translateX(5px); }
}
.pb-sprite.is-hit { animation: pbHit .3s linear; }

/* ダメージ確定後の明滅。本家準拠でキッチリ2回消えるゾ */
/* ダメージ確定後の明滅。150msごとに 消→点→消 で、キッチリ2回だゾ */
@keyframes pbBlinkHit {
    0%   { opacity: 1; }
    25%  { opacity: 0; }   /* 1回目 */
    50%  { opacity: 1; }
    75%  { opacity: 0; }   /* 2回目 */
    100% { opacity: 1; }
}
.pb-sprite.is-blink { animation: pbBlinkHit .4s steps(1, end); }

/* 倒れた時 */
@keyframes pbFaint {
    to { transform: translateY(70px); opacity: 0; }
}
.pb-sprite.is-faint { animation: pbFaint .6s ease-in forwards; }

/* ---- HPゲージ ---- */
.pb-status {
    background-color: #f8f0d8;
    border: 3px solid #333;
    border-radius: 6px;
    padding: 6px 10px 7px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
    text-align: left;
    min-width: 190px;
}
.pb-status-foe  { margin-bottom: 10px; }
.pb-status-ally { margin-top: 14px; }

.pb-status-name {
    font-weight: bold;
    font-size: 0.85em;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.pb-status-name .pb-type { font-size: 0.7em; padding: 1px 8px; }

.pb-hp-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.pb-hp-label {
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 0.75em;
    color: #d8a000;
    letter-spacing: 0.05em;
}
.pb-hp-track {
    flex: 1;
    height: 8px;
    background-color: #444;
    border-radius: 4px;
    padding: 1px;
}
.pb-hp-fill {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: 4px;
    background-color: #58d858;
    transition: background-color .3s ease;   /* ← width を消す */
}
.pb-hp-fill.is-mid { background-color: #f8d030; }
.pb-hp-fill.is-low { background-color: #f85038; }

.pb-hp-num {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.75em;
    text-align: right;
    color: #333;
    margin-top: 2px;
}

/* ---- メッセージウィンドウ ---- */
.pb-textbox {
    position: relative;
    min-height: 86px;
    background-color: #f8f8f8;
    border: 3px solid #333;
    border-radius: 0 0 8px 8px;
    padding: 14px 16px;
    box-shadow: inset 0 0 0 3px #f8f8f8, inset 0 0 0 5px #4880c8;
    cursor: pointer;
}
.pb-message {
    margin: 0;
    font-size: 1.02em;
    line-height: 1.65;
    color: #222;
    font-weight: bold;
    white-space: pre-wrap;
}
@keyframes pbBlink { 50% { opacity: 0; } }
.pb-next {
    position: absolute;
    right: 16px;
    bottom: 10px;
    color: #4880c8;
    font-size: 0.9em;
    animation: pbBlink 0.85s steps(1) infinite;
}

/* ---- わざメニュー ---- */
.pb-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.pb-move {
    text-align: left;
    padding: 10px 12px;
    background-color: #fff;
    border: 3px solid #333;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color .12s ease, transform .08s ease;
}
.pb-move:hover { background-color: #ffeeaa; }
.pb-move:active { transform: translateY(2px); }
.pb-move:focus-visible { outline: 3px solid #ffcc00; outline-offset: 2px; }
.pb-move-name {
    display: block;
    font-weight: bold;
    font-size: 0.95em;
    color: #222;
}
.pb-move-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 0.72em;
    color: #777;
    font-family: Consolas, "Courier New", monospace;
}

/* ---- 決着 ---- */
.pb-result { margin-top: 14px; text-align: center; }
.pb-result-text {
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 1.5em;
    letter-spacing: 0.06em;
    color: #e3350d;
    margin: 0 0 12px;
}
.pb-again {
    padding: 10px 26px;
    font-weight: bold;
    color: #fff;
    background-color: #004488;
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 0 #002d5c;
    cursor: pointer;
}
.pb-again:active { transform: translateY(4px); box-shadow: 0 0 0; }
.pb-again:focus-visible { outline: 3px solid #ffcc00; outline-offset: 3px; }

/* ---- 計算方法の表 ---- */
.pb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
    margin: 12px 0;
}
.pb-table th, .pb-table td {
    border: 1px solid #ccddee;
    padding: 7px 10px;
    text-align: left;
}
.pb-table th { background-color: #eef3f8; font-weight: bold; }

/* ============ スマホ対応 ============ */
@media (max-width: 767px) {
    .pb-select-row { flex-wrap: wrap; }
    .pb-select-col { flex: 1 1 100%; }
    .pb-select-vs { width: 100%; text-align: center; padding: 2px 0; }
    .pb-cards { grid-template-columns: 1fr; }

    .pb-field { height: 250px; }
    .pb-status { min-width: 150px; }
    .pb-slot-foe  { right: 8px; top: 8px; }
    .pb-slot-ally { left: 8px; bottom: 8px; }
    .pb-sprite-foe img,  .pb-sprite-foe .pb-noicon  { width: 68px; height: 68px; font-size: 1.8em; }
    .pb-sprite-ally img, .pb-sprite-ally .pb-noicon { width: 88px; height: 88px; font-size: 2.2em; }
    .pb-sprite-foe::after  { width: 78px;  height: 16px; }
    .pb-sprite-ally::after { width: 100px; height: 20px; }
    .pb-status-name { font-size: 0.75em; }
    .pb-menu { grid-template-columns: 1fr; }
}

/* ============ アニメーションを切っている人向け ============ */
@media (prefers-reduced-motion: reduce) {
    .pb-sprite.is-hit,
    .pb-sprite.is-hit,
    .pb-sprite.is-blink,
    .pb-sprite.is-faint,
    .pb-sprite.is-faint,
    .pb-next { animation: none; }
    .pb-hp-fill, .pb-stat-bar i { transition: none; }
    .pb-sprite.is-faint { opacity: 0; }
    
}
/* 両方付いたときは明示的に並べる。ショートハンドは後勝ちで消えるからゾ */
.pb-sprite.is-hit.is-blink {
    animation: pbHit .3s linear, pbBlinkHit .6s steps(1, end);
}
/* ---- 処理中はわざボタンを押せなくするゾ（連打によるターン多重進行の防止） ---- */
.pb-move:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background-color: #f2f2f2;
}
.pb-move:disabled:hover { background-color: #f2f2f2; }

/* ====================================================================
   攻撃エフェクト
==================================================================== */

/* ---- 1. 攻撃側の踏み込み ---- */
@keyframes pbLungeAlly {
    0%   { transform: translate(0, 0); }
    30%  { transform: translate(26px, -18px); }
    55%  { transform: translate(26px, -18px); }
    100% { transform: translate(0, 0); }
}
@keyframes pbLungeFoe {
    0%   { transform: translate(0, 0); }
    30%  { transform: translate(-26px, 18px); }
    55%  { transform: translate(-26px, 18px); }
    100% { transform: translate(0, 0); }
}
.pb-sprite.is-lunge-ally { animation: pbLungeAlly .42s ease-in-out; }
.pb-sprite.is-lunge-foe  { animation: pbLungeFoe  .42s ease-in-out; }

/* ---- 2. 着弾の衝撃波 ---- */
.pb-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
    /* 中心から外へ広がるリング。色はタイプごとに下で上書きするゾ */
    background: radial-gradient(circle, rgba(255,255,255,.95) 0%, currentColor 45%, transparent 70%);
    animation: pbBurst .5s cubic-bezier(0.16, 0.9, 0.36, 1) forwards;
}
@keyframes pbBurst {
    0%   { transform: scale(0.2); opacity: 1; }
    60%  { opacity: .85; }
    100% { transform: scale(6.5); opacity: 0; }
}
/* currentColor を使うので color だけ指定すれば効くのぜ */
.pb-burst-ninki   { color: #f8d030; }
.pb-burst-koryu   { color: #6890f0; }
.pb-burst-hasshin { color: #f08030; }
.pb-burst-shushu  { color: #78c850; }

/* ---- 3. ダメージ数値 ---- */
.pb-damage {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    pointer-events: none;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 1.5em;
    color: #fff;
    text-shadow:
        0 0 3px #000, 1px 1px 0 #000, -1px 1px 0 #000,
        1px -1px 0 #000, -1px -1px 0 #000;
    animation: pbDamage 1.1s ease-out forwards;
}
.pb-damage.is-crit {
    color: #ffe14d;
    font-size: 2em;
}
@keyframes pbDamage {
    0%   { transform: translate(-50%, 6px) scale(0.6); opacity: 0; }
    18%  { transform: translate(-50%, -6px) scale(1.15); opacity: 1; }
    30%  { transform: translate(-50%, -4px) scale(1); opacity: 1; }
    75%  { opacity: 1; }
    100% { transform: translate(-50%, -46px) scale(1); opacity: 0; }
}

/* ---- 4. フィールド全体のフラッシュと揺れ ---- */
@keyframes pbFlashSuper {
    0%, 100% { filter: none; transform: translate(0, 0); }
    12%      { filter: brightness(1.75) saturate(1.3); transform: translate(-4px, 2px); }
    30%      { filter: brightness(1.2); transform: translate(4px, -2px); }
    48%      { filter: brightness(1.4); transform: translate(-3px, 1px); }
    70%      { filter: none; transform: translate(2px, 0); }
}
@keyframes pbFlashCrit {
    0%, 100% { filter: none; transform: translate(0, 0); }
    8%       { filter: brightness(2.4) contrast(1.2); transform: translate(-7px, 4px); }
    20%      { filter: brightness(1.1); transform: translate(7px, -4px); }
    34%      { filter: brightness(1.9); transform: translate(-6px, 3px); }
    50%      { filter: brightness(1.1); transform: translate(5px, -2px); }
    72%      { filter: none; transform: translate(-3px, 1px); }
}
.pb-field.is-flash-super { animation: pbFlashSuper .45s ease-out; }
.pb-field.is-flash-crit  { animation: pbFlashCrit  .55s ease-out; }

/* ---- アニメーションを切っている人向け ---- */
@media (prefers-reduced-motion: reduce) {
    .pb-sprite.is-lunge-ally,
    .pb-sprite.is-lunge-foe,
    .pb-burst,
    .pb-field.is-flash-super,
    .pb-field.is-flash-crit { animation: none; }
    .pb-burst { display: none; }
    /* ダメージ数値だけは情報なので、動かさずに一瞬出して消すゾ */
    .pb-damage { animation: pbDamageStatic 1s linear forwards; }
    @keyframes pbDamageStatic {
        0%, 80% { opacity: 1; transform: translate(-50%, -20px); }
        100%    { opacity: 0; transform: translate(-50%, -20px); }
    }
}