/* ===================================
   FE烈火の剣 ボスラッシュシミュレーター
   スタイルシート
=================================== */

:root {
    /* カラーパレット - FE風の重厚なテーマ */
    --color-bg: #0a0e17;
    --color-bg-panel: #131a2a;
    --color-bg-input: #1a2438;
    --color-primary: #c9a227;
    --color-primary-dark: #9a7b1a;
    --color-accent: #e74c3c;
    --color-success: #27ae60;
    --color-text: #e8e6e3;
    --color-text-dim: #8b8d8f;
    --color-border: #2a3a52;
    
    /* フォント */
    --font-main: 'Noto Sans JP', sans-serif;
    --font-display: 'Orbitron', sans-serif;
    
    /* スペーシング */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
}

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

body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
    
    /* 背景パターン */
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(201, 162, 39, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(231, 76, 60, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, #0a0e17 0%, #0d1220 100%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
}

/* ===================================
   ヘッダー
=================================== */
.header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--color-border);
}

.title {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.title-sub {
    font-size: 0.9rem;
    color: var(--color-primary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.title-main {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-primary) 0%, #f4d03f 50%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(201, 162, 39, 0.3);
}

.subtitle {
    margin-top: var(--space-md);
    color: var(--color-text-dim);
    font-size: 1.1rem;
}

/* ===================================
   メインレイアウト
=================================== */
.main {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-xl);
}

@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   パネル共通
=================================== */
.panel {
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: var(--space-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.panel-title .icon {
    font-size: 1.4rem;
}

/* ===================================
   フォーム要素
=================================== */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: 0.9rem;
    color: var(--color-text-dim);
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

/* ステータスグリッド */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.stat-input {
    text-align: center;
}

.stat-input label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-dim);
    margin-bottom: var(--space-xs);
}

.stat-input input {
    text-align: center;
    padding: var(--space-sm);
}

/* ===================================
   ボタン
=================================== */
.btn-primary {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    margin-top: var(--space-md);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 162, 39, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.3rem;
}

/* ===================================
   結果パネル
=================================== */
.result-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.result-summary.hidden {
    display: none;
}

.summary-card {
    background: var(--color-bg-input);
    border-radius: 8px;
    padding: var(--space-md);
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-dim);
    margin-bottom: var(--space-xs);
}

.summary-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.summary-unit {
    font-size: 1rem;
    color: var(--color-text-dim);
}

.summary-rank {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
}

.summary-rank.rank-s { color: #f1c40f; }
.summary-rank.rank-a { color: #27ae60; }
.summary-rank.rank-b { color: #3498db; }
.summary-rank.rank-c { color: #9b59b6; }
.summary-rank.rank-d { color: #e74c3c; }

/* バトルログ */
.battle-log {
    max-height: 500px;
    overflow-y: auto;
}

.battle-log .placeholder {
    text-align: center;
    color: var(--color-text-dim);
    padding: var(--space-xl);
}

.battle-log .placeholder p {
    margin: var(--space-xs) 0;
}

/* バトルカード */
.battle-card {
    background: var(--color-bg-input);
    border-radius: 8px;
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border-left: 4px solid var(--color-border);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.battle-card.win {
    border-left-color: var(--color-success);
}

.battle-card.lose {
    border-left-color: var(--color-accent);
}

.battle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.boss-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.boss-class {
    font-size: 0.85rem;
    color: var(--color-text-dim);
}

.battle-result {
    font-weight: 700;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 4px;
    font-size: 0.9rem;
}

.battle-result.win {
    background: rgba(39, 174, 96, 0.2);
    color: var(--color-success);
}

.battle-result.lose {
    background: rgba(231, 76, 60, 0.2);
    color: var(--color-accent);
}

.battle-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--color-text-dim);
}

.battle-stats-row {
    display: flex;
    justify-content: space-between;
}

.battle-detail {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

/* ===================================
   フッター
=================================== */
.footer {
    text-align: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-dim);
    font-size: 0.85rem;
}

.footer p {
    margin: var(--space-xs) 0;
}

/* ===================================
   スクロールバー
=================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-dark);
}

/* ===================================
   レベル入力エリア
=================================== */
.level-input-area {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: rgba(201, 162, 39, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.level-group {
    flex: 0 0 80px;
    margin-bottom: 0;
}

.level-group input {
    text-align: center;
}

.cc-group {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: border-color 0.2s, background 0.2s;
}

.checkbox-label:hover {
    border-color: var(--color-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.checkbox-label span {
    font-size: 0.9rem;
    color: var(--color-text);
}

.btn-calc {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg-input);
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-calc:hover {
    background: rgba(201, 162, 39, 0.1);
    transform: translateY(-1px);
}

.btn-calc:active {
    transform: translateY(0);
}

/* ステータス計算後のハイライト */
.stat-input input.calculated {
    border-color: var(--color-primary);
    background: rgba(201, 162, 39, 0.1);
}

/* ===================================
   モード選択タブ
=================================== */
.mode-selector {
    margin-bottom: var(--space-md);
}

.mode-tabs {
    display: flex;
    gap: 2px;
    background: var(--color-border);
    border-radius: 8px;
    padding: 2px;
}

.mode-tab {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--color-text-dim);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.2s;
}

.mode-tab:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
    background: var(--color-bg-panel);
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* HP回復オプション */
.hp-recovery-option {
    margin-bottom: var(--space-md);
}

.hp-recovery-option.hidden {
    display: none;
}

.radio-group {
    display: flex;
    gap: var(--space-sm);
}

.radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.radio-label:hover {
    border-color: var(--color-primary);
}

.radio-label:has(input:checked) {
    border-color: var(--color-primary);
    background: rgba(201, 162, 39, 0.1);
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.radio-label span {
    font-size: 0.9rem;
    color: var(--color-text);
}

/* ===================================
   100連戦結果表示
=================================== */
.result-100-summary {
    background: var(--color-bg-input);
    border-radius: 12px;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.result-100-summary.hidden {
    display: none;
}

.result-100-header {
    margin-bottom: var(--space-lg);
}

.enemy-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.vs-text {
    font-size: 1rem;
    color: var(--color-text-dim);
    margin-left: var(--space-sm);
}

.result-100-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.stat-box {
    text-align: center;
    padding: var(--space-md) var(--space-xl);
    border-radius: 8px;
    background: var(--color-bg-panel);
}

.stat-box.win {
    border: 2px solid var(--color-success);
}

.stat-box.lose {
    border: 2px solid var(--color-accent);
}

.stat-box .stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-dim);
    margin-bottom: var(--space-xs);
}

.stat-box .stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-box.win .stat-value {
    color: var(--color-success);
}

.stat-box.lose .stat-value {
    color: var(--color-accent);
}

.stat-box .stat-unit {
    font-size: 1rem;
    color: var(--color-text-dim);
}

/* 勝率バー */
.win-rate-bar {
    height: 12px;
    background: rgba(231, 76, 60, 0.3);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.win-rate-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-success) 0%, #2ecc71 100%);
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

.win-rate-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

.win-rate-text span {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
}

.result-100-detail {
    background: var(--color-bg-panel);
    border-radius: 8px;
    padding: var(--space-md);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    font-size: 0.9rem;
    color: var(--color-text-dim);
}

.detail-row span:last-child {
    color: var(--color-text);
    font-weight: 600;
}

/* 100連戦のバトルログ */
.battle-100-log {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 4px;
    padding: var(--space-sm);
}

.battle-100-item {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: help;
    transition: transform 0.1s;
}

.battle-100-item:hover {
    transform: scale(1.2);
    z-index: 1;
}

.battle-100-item.win {
    background: var(--color-success);
    color: #fff;
}

.battle-100-item.lose {
    background: var(--color-accent);
    color: #fff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 特効バッジ */
.effective-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 4px rgba(255, 107, 53, 0.5);
    }
    50% {
        box-shadow: 0 0 12px rgba(255, 107, 53, 0.8);
    }
}

/* 100連戦 戦闘統計 */
.battle-stats-100 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.stats-section {
    background: var(--color-bg-dark);
    border-radius: 8px;
    padding: 12px;
}

.stats-section.player-stats {
    border-left: 3px solid var(--color-success);
}

.stats-section.boss-stats {
    border-left: 3px solid var(--color-accent);
}

.stats-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-name {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.stat-val {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.player-stats .stat-val {
    color: var(--color-success);
}

.boss-stats .stat-val {
    color: var(--color-accent);
}

@media (max-width: 480px) {
    .battle-stats-100 {
        grid-template-columns: 1fr;
    }
}

/* 必殺表示 */
.crit-display {
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(255, 200, 0, 0.15), rgba(255, 100, 0, 0.15));
    border-radius: 6px;
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    animation: critFlash 0.5s ease-out;
}

@keyframes critFlash {
    0% {
        background: rgba(255, 200, 0, 0.5);
    }
    100% {
        background: linear-gradient(135deg, rgba(255, 200, 0, 0.15), rgba(255, 100, 0, 0.15));
    }
}

.crit-player {
    color: #ffc107;
}

.crit-boss {
    color: #ff5722;
}

/* 100連戦タイルの必殺表示 */
.battle-100-item.player-crit {
    position: relative;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.8);
}

.battle-100-item.boss-crit.lose {
    box-shadow: 0 0 8px rgba(255, 87, 34, 0.8);
}

.battle-100-item .tile-num {
    font-size: 0.6rem;
}

.battle-100-item .tile-crit {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.5rem;
    animation: critBounce 0.3s ease-out;
}

@keyframes critBounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.5);
    }
    100% {
        transform: scale(1);
    }
}

/* 必殺発生カウント */
.crit-count {
    grid-column: 1 / -1;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px dashed var(--color-border);
    margin-top: 4px;
}

.crit-val {
    color: #ffc107 !important;
    font-size: 1.1rem !important;
}

.boss-stats .crit-val {
    color: #ff5722 !important;
}

/* ===================================
   スマートフォン対応
=================================== */

/* タブレット (768px以下) */
@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
    }
    
    .header {
        padding: var(--space-lg) 0;
        margin-bottom: var(--space-lg);
    }
    
    .title-main {
        font-size: 1.8rem;
    }
    
    .title-sub {
        font-size: 0.8rem;
        letter-spacing: 0.2em;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .panel {
        padding: var(--space-md);
    }
    
    .panel-title {
        font-size: 1.1rem;
        margin-bottom: var(--space-md);
    }
    
    /* ステータスグリッド 2列 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    /* レベル入力エリア */
    .level-input-area {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }
    
    .level-group {
        flex: 0 0 60px;
    }
    
    .btn-calc {
        flex: 1 0 100%;
        margin-top: var(--space-xs);
    }
    
    /* 100連戦統計 */
    .result-100-stats {
        gap: var(--space-md);
    }
    
    .stat-box {
        padding: var(--space-sm) var(--space-md);
    }
    
    .stat-box .stat-value {
        font-size: 2rem;
    }
    
    .enemy-name {
        font-size: 1.3rem;
    }
    
    .win-rate-text span {
        font-size: 1.5rem;
    }
}

/* スマートフォン (480px以下) */
@media (max-width: 480px) {
    :root {
        --space-lg: 1rem;
        --space-xl: 1.25rem;
    }
    
    .container {
        padding: var(--space-sm);
    }
    
    .header {
        padding: var(--space-md) 0;
        margin-bottom: var(--space-md);
    }
    
    .title-main {
        font-size: 1.4rem;
    }
    
    .title-sub {
        font-size: 0.7rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
        margin-top: var(--space-sm);
    }
    
    .panel {
        padding: var(--space-sm);
        border-radius: 8px;
    }
    
    .panel-title {
        font-size: 1rem;
        padding-bottom: var(--space-sm);
        margin-bottom: var(--space-md);
    }
    
    .panel-title .icon {
        font-size: 1.2rem;
    }
    
    /* フォーム要素 */
    input[type="text"],
    input[type="number"],
    select {
        padding: var(--space-sm);
        font-size: 16px; /* iOSズーム防止 */
    }
    
    .form-group {
        margin-bottom: var(--space-sm);
    }
    
    .form-group label {
        font-size: 0.8rem;
    }
    
    /* ステータスグリッド */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .stat-input label {
        font-size: 0.65rem;
    }
    
    .stat-input input {
        padding: var(--space-xs);
        font-size: 14px;
    }
    
    /* レベル入力エリア */
    .level-input-area {
        padding: var(--space-sm);
        flex-direction: column;
        align-items: stretch;
    }
    
    .level-group {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .level-group input {
        width: 100%;
    }
    
    .cc-group {
        width: 100%;
    }
    
    .checkbox-label {
        width: 100%;
        justify-content: center;
    }
    
    .btn-calc {
        width: 100%;
        padding: var(--space-sm);
    }
    
    /* モードタブ */
    .mode-tabs {
        gap: 1px;
    }
    
    .mode-tab {
        padding: var(--space-sm);
        font-size: 0.8rem;
    }
    
    /* HP回復オプション */
    .radio-group {
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .radio-label {
        padding: var(--space-sm);
    }
    
    .radio-label span {
        font-size: 0.85rem;
    }
    
    /* 開始ボタン */
    .btn-primary {
        padding: var(--space-md);
        font-size: 1rem;
        min-height: 48px; /* タッチターゲット */
    }
    
    /* 結果サマリー */
    .result-summary {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }
    
    .summary-value {
        font-size: 2rem;
    }
    
    .summary-rank {
        font-size: 2rem;
    }
    
    /* 100連戦 */
    .result-100-summary {
        padding: var(--space-md);
    }
    
    .result-100-header {
        margin-bottom: var(--space-md);
    }
    
    .enemy-name {
        font-size: 1.1rem;
        display: block;
    }
    
    .vs-text {
        display: block;
        margin-left: 0;
        margin-top: var(--space-xs);
        font-size: 0.85rem;
    }
    
    .result-100-stats {
        flex-direction: row;
        gap: var(--space-sm);
    }
    
    .stat-box {
        flex: 1;
        padding: var(--space-sm);
    }
    
    .stat-box .stat-value {
        font-size: 1.6rem;
    }
    
    .stat-box .stat-label {
        font-size: 0.7rem;
    }
    
    .stat-box .stat-unit {
        font-size: 0.8rem;
    }
    
    .win-rate-text {
        font-size: 1rem;
    }
    
    .win-rate-text span {
        font-size: 1.3rem;
    }
    
    .result-100-detail {
        padding: var(--space-sm);
    }
    
    .detail-row {
        font-size: 0.8rem;
    }
    
    /* 戦闘統計グリッド */
    .battle-stats-100 {
        gap: var(--space-sm);
        margin-top: var(--space-md);
        padding-top: var(--space-md);
    }
    
    .stats-section {
        padding: var(--space-sm);
    }
    
    .stats-header {
        font-size: 0.75rem;
        margin-bottom: var(--space-sm);
    }
    
    .stats-grid {
        gap: 6px;
    }
    
    .stat-name {
        font-size: 0.6rem;
    }
    
    .stat-val {
        font-size: 0.9rem;
    }
    
    .crit-count {
        padding-top: 6px;
        margin-top: 2px;
    }
    
    .crit-val {
        font-size: 0.95rem !important;
    }
    
    /* バトルログ */
    .battle-log {
        max-height: 400px;
    }
    
    .battle-card {
        padding: var(--space-sm);
        margin-bottom: var(--space-sm);
    }
    
    .battle-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }
    
    .boss-name {
        font-size: 1rem;
    }
    
    .boss-class {
        font-size: 0.75rem;
    }
    
    .battle-result {
        font-size: 0.8rem;
        align-self: flex-end;
        margin-top: -1.5rem;
    }
    
    .battle-stats {
        grid-template-columns: 1fr;
        gap: var(--space-xs);
        font-size: 0.8rem;
    }
    
    .battle-detail {
        font-size: 0.75rem;
    }
    
    .crit-display {
        font-size: 0.75rem;
        padding: 6px 10px;
        gap: 8px;
    }
    
    .effective-badge {
        font-size: 0.6rem;
        padding: 1px 4px;
        margin-left: 4px;
    }
    
    /* 100連戦タイル */
    .battle-100-log {
        grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
        gap: 3px;
        padding: var(--space-xs);
    }
    
    .battle-100-item {
        font-size: 0.6rem;
    }
    
    .battle-100-item .tile-crit {
        font-size: 0.4rem;
        top: -3px;
        right: -3px;
    }
    
    /* フッター */
    .footer {
        margin-top: var(--space-lg);
        padding-top: var(--space-md);
        font-size: 0.75rem;
    }
}

/* 極小スマホ (360px以下) */
@media (max-width: 360px) {
    .title-main {
        font-size: 1.2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2px;
    }
    
    .stat-input input {
        padding: 4px;
        font-size: 13px;
    }
    
    .stat-input label {
        font-size: 0.6rem;
    }
    
    .stat-box .stat-value {
        font-size: 1.4rem;
    }
    
    .battle-100-log {
        grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    }
}

/* タッチデバイス向けのホバー無効化 */
@media (hover: none) {
    .btn-primary:hover {
        transform: none;
        box-shadow: none;
    }
    
    .btn-calc:hover {
        background: var(--color-bg-input);
        transform: none;
    }
    
    .battle-100-item:hover {
        transform: none;
    }
    
    /* タップ時のフィードバック */
    .btn-primary:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .btn-calc:active {
        background: rgba(201, 162, 39, 0.15);
    }
    
    .mode-tab:active {
        background: rgba(255, 255, 255, 0.1);
    }
}

