/* ========================================================
   知恵の迷宮 - クイズ・オブ・レジェンド (Quiz RPG) スタイル
   ======================================================== */

:root {
    --bg-dark: #0f111a;
    --bg-card: #1a1d2e;
    --bg-card-secondary: #23273e;
    --border-color: #343a56;
    --primary-gold: #f1c40f;
    --primary-cyan: #00d2d3;
    --accent-red: #ff4757;
    --accent-green: #2ecc71;
    --accent-purple: #9b59b6;
    --text-main: #f1f2f6;
    --text-muted: #a4b0be;
    --font-family: 'Segoe UI', 'Meiryo', 'Hiragino Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0b0c14 100%);
}

#game-container {
    width: 100%;
    max-width: 900px;
    min-height: 680px;
    height: 94vh;
    background: rgba(20, 24, 40, 0.95);
    border: 2px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(112, 111, 211, 0.15);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 共通ユーティリティ */
.hidden {
    display: none !important;
}

button {
    font-family: var(--font-family);
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- タイトルバー / ヘッダー --- */
.game-header {
    background: linear-gradient(180deg, #242944 0%, #171b30 100%);
    border-bottom: 2px solid var(--border-color);
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    z-index: 10;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-badge {
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-badge.gold {
    color: var(--primary-gold);
}

.btn-header-nav {
    background: #343a56;
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
}

.btn-header-nav:hover {
    background: #4b537c;
    transform: translateY(-1px);
}

/* --- シーン共通 --- */
.game-scene {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    padding: 16px;
}

/* --- タイトルシーン --- */
#title-scene {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at 50% 40%, rgba(108, 92, 231, 0.25) 0%, transparent 70%);
}

.title-logo-container {
    margin-bottom: 30px;
}

.title-sub {
    font-size: 1.1rem;
    color: var(--primary-cyan);
    letter-spacing: 4px;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(0, 210, 211, 0.6);
}

.title-main {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 25px rgba(241, 196, 15, 0.7), 0 4px 8px #000;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 30%, #f1c40f 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-menu-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 280px;
}

.btn-title {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #4834d4 0%, #686de0 100%);
    border: 1px solid #7ed6df;
    box-shadow: 0 4px 15px rgba(72, 52, 212, 0.4);
}

.btn-title:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(104, 109, 224, 0.6);
}

.btn-title:disabled {
    background: #343a56;
    border-color: #4b537c;
    color: #718093;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-title.secondary {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-color: #7f8c8d;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-title.secondary:hover {
    background: linear-gradient(135deg, #34495e 0%, #4b6584 100%);
}

.title-settings-bar {
    margin-top: 35px;
    display: flex;
    gap: 24px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.audio-control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- ステージ選択シーン --- */
.scene-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-gold);
}

.stage-buttons-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding-bottom: 20px;
}

.stage-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stage-card.unlocked:hover {
    border-color: var(--primary-cyan);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 210, 211, 0.25);
    background: var(--bg-card-secondary);
}

.stage-card.locked {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.8);
}

.stage-card.boss-stage {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #1e1022 0%, #291220 100%);
}

.stage-card.boss-stage.unlocked:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.35);
}

.stage-card.endless-stage {
    grid-column: 1 / -1;
    border-color: #9b59b6;
    background: linear-gradient(135deg, #1c142e 0%, #291b42 100%);
}

.stage-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.stage-num {
    font-weight: bold;
    color: var(--primary-gold);
}

.stage-boss-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}

.stage-boss-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- バトルシーン --- */
#battle-scene {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    overflow: hidden;
}

.battle-arena {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    height: 48%;
    min-height: 220px;
}

/* 敵カード */
.combatant-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.enemy-card {
    align-items: center;
    background: radial-gradient(circle at 50% 60%, rgba(231, 76, 60, 0.1) 0%, var(--bg-card) 75%);
}

.enemy-graphic-wrapper {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 160px;
}

.enemy-svg {
    width: 100%;
    height: 100%;
    max-height: 150px;
    animation: floatEnemy 3s ease-in-out infinite alternate;
}

@keyframes floatEnemy {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-8px); }
}

.combatant-info {
    width: 100%;
}

.combatant-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.combatant-name {
    font-weight: bold;
    font-size: 1.05rem;
}

.combatant-title {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.bar-container {
    width: 100%;
    height: 14px;
    background: #111422;
    border-radius: 8px;
    border: 1px solid #3d4566;
    overflow: hidden;
    position: relative;
    margin-top: 4px;
}

.hp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71 0%, #1abc9c 100%);
    transition: width 0.3s ease;
}

.enemy-hp-fill {
    background: linear-gradient(90deg, #e74c3c 0%, #ff6b6b 100%);
}

.sp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #9b59b6 0%, #e056fd 100%);
    transition: width 0.3s ease;
}

.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: bold;
    text-shadow: 0 0 3px #000;
}

/* プレイヤーカード */
.player-card {
    background: radial-gradient(circle at 50% 60%, rgba(52, 152, 219, 0.1) 0%, var(--bg-card) 75%);
}

.player-action-strip {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.btn-item-slot {
    flex: 1;
    background: #252b45;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    padding: 5px;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.btn-item-slot:hover {
    background: #343d63;
    border-color: var(--primary-cyan);
}

.btn-ultimate-action {
    flex: 1.4;
    background: linear-gradient(135deg, #8e44ad 0%, #e84393 100%);
    border: 1px solid #fd79a8;
    color: #fff;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.btn-ultimate-action:disabled {
    background: #2b2e3e;
    border-color: #3f455e;
    color: #718093;
    cursor: not-allowed;
}

/* バトルログ */
.battle-log-strip {
    height: 48px;
    background: rgba(10, 12, 20, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.8rem;
    overflow-y: auto;
    margin: 8px 0;
}

.log-line {
    line-height: 1.4;
}

.log-player { color: var(--primary-cyan); }
.log-enemy { color: var(--accent-red); }
.log-system { color: var(--primary-gold); }

/* 下部アクションエリア (ジャンル選択 or クイズ) */
.battle-interactive-zone {
    height: 44%;
    min-height: 200px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ジャンル選択 */
.genre-select-title {
    text-align: center;
    font-size: 0.95rem;
    color: var(--primary-gold);
    font-weight: bold;
    margin-bottom: 12px;
}

.genre-cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.genre-card {
    background: var(--bg-card-secondary);
    border: 2px solid var(--genre-color);
    border-radius: 12px;
    padding: 14px 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.genre-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 6px 20px var(--genre-color);
    background: rgba(255, 255, 255, 0.05);
}

.genre-icon {
    font-size: 1.8rem;
}

.genre-name {
    font-size: 1.05rem;
    font-weight: bold;
    color: #fff;
}

.genre-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* クイズ出題 */
.question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.genre-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
}

.turn-badge {
    background: #34495e;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.timer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.timer-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timer-bar-track {
    width: 100%;
    max-width: 180px;
    height: 8px;
    background: #111;
    border-radius: 4px;
    overflow: hidden;
}

.timer-bar-fill {
    height: 100%;
    background-color: var(--accent-green);
    transition: width 0.1s linear, background-color 0.3s ease;
}

.question-text {
    font-size: 1.05rem;
    font-weight: bold;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 14px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-gold);
    margin-bottom: 12px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option-btn {
    background: var(--bg-card-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 0.95rem;
    text-align: left;
}

.option-btn:hover:not(:disabled) {
    background: #343d63;
    border-color: var(--primary-cyan);
    transform: translateY(-2px);
}

.option-number {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.btn-correct {
    background: #27ae60 !important;
    border-color: #2ecc71 !important;
    animation: correctPulse 0.5s ease;
}

.btn-wrong {
    background: #c0392b !important;
    border-color: #e74c3c !important;
    animation: wrongShake 0.4s ease;
}

.btn-correct-hint {
    border: 2px dashed #2ecc71 !important;
    background: rgba(46, 204, 113, 0.2) !important;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* --- ショップシーン --- */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.shop-category-title {
    font-size: 1.1rem;
    color: var(--primary-gold);
    margin: 16px 0 10px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.shop-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
}

.shop-card.item-equipped {
    border-color: var(--accent-green);
    background: rgba(46, 204, 113, 0.08);
}

.shop-card-icon {
    font-size: 2rem;
}

.shop-card-name {
    font-weight: bold;
    font-size: 1rem;
}

.shop-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-height: 38px;
}

.shop-card-price {
    font-weight: bold;
    color: var(--primary-gold);
}

.btn-buy, .btn-equip {
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: bold;
    color: #fff;
    background: #27ae60;
}

.btn-buy:hover:not(:disabled), .btn-equip:hover:not(:disabled) {
    background: #2ecc71;
    transform: translateY(-1px);
}

.btn-disabled {
    background: #34495e;
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- ステータス画面 --- */
.status-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.status-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
}

.status-box h3 {
    font-size: 1.1rem;
    color: var(--primary-gold);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
}

.status-row-label {
    color: var(--text-muted);
}

.status-row-value {
    font-weight: bold;
}

/* --- 自作クイズエディタ --- */
.custom-quiz-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-control {
    background: #111422;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-cyan);
}

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

.btn-form-submit {
    background: linear-gradient(135deg, #0984e3 0%, #00cec9 100%);
    color: #fff;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    margin-top: 6px;
}

.custom-quiz-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
}

.custom-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.btn-delete-quiz {
    background: #c0392b;
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* --- モーダル (解説、リザルト、敗北) --- */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-title {
    font-size: 1.6rem;
    font-weight: bold;
}

.modal-body {
    background: rgba(0, 0, 0, 0.3);
    padding: 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
}

.btn-modal-action {
    background: linear-gradient(135deg, #0984e3 0%, #00cec9 100%);
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 12px;
    border-radius: 10px;
}

.btn-modal-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 206, 201, 0.4);
}

/* --- ダメージポップアップ & シェイク演出 --- */
.damage-popup {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 0 0 8px #000, 0 0 12px currentColor;
    pointer-events: none;
    animation: damageFlyUp 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    z-index: 50;
}

@keyframes damageFlyUp {
    0% { transform: translate(-50%, 0) scale(0.6); opacity: 0; }
    20% { transform: translate(-50%, -20px) scale(1.3); opacity: 1; }
    80% { transform: translate(-50%, -45px) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -65px) scale(0.9); opacity: 0; }
}

.floating-notice-banner {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 1.4rem;
    font-weight: 900;
    text-shadow: 0 0 10px currentColor;
    pointer-events: none;
    z-index: 60;
    animation: noticeFade 1.4s ease forwards;
}

@keyframes noticeFade {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -70%) scale(0.9); opacity: 0; }
}

.shake-anim {
    animation: hitShake 0.35s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes hitShake {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(5px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

.screen-shake {
    animation: screenShakeAnim 0.3s cubic-bezier(.36,.07,.19,.97) both;
}

.screen-heavy-shake {
    animation: screenHeavyShakeAnim 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes screenShakeAnim {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-4px, 4px); }
    75% { transform: translate(4px, -4px); }
}

@keyframes screenHeavyShakeAnim {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-8px, -6px); }
    30% { transform: translate(9px, 7px); }
    50% { transform: translate(-7px, 6px); }
    70% { transform: translate(6px, -5px); }
    90% { transform: translate(-3px, 2px); }
}

.glow-pulse {
    animation: pulseGlow 1.2s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 6px #fd79a8; }
    100% { box-shadow: 0 0 20px #e84393, 0 0 35px #fd79a8; }
}

.header-badge.score {
    color: #ff9ff3;
    border-color: rgba(255, 159, 243, 0.4);
}

.btn-nav-ranking {
    background: linear-gradient(135deg, #d35400 0%, #f39c12 100%) !important;
    color: #fff !important;
    border: 1px solid #f1c40f !important;
}

.btn-title-highlight {
    background: linear-gradient(135deg, #e67e22 0%, #f1c40f 100%) !important;
    border-color: #ffeaa7 !important;
    color: #000 !important;
}

/* --- ランキングシーン --- */
.ranking-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.my-score-submit-card {
    background: linear-gradient(135deg, #1b1e33 0%, #262c4a 100%);
    border: 2px solid #575fcf;
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(87, 95, 207, 0.2);
}

.my-score-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--primary-cyan);
    margin-bottom: 10px;
}

.my-score-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.my-stat-box {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.my-stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.my-stat-val {
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--primary-gold);
}

.my-score-form {
    display: flex;
    gap: 10px;
}

.my-score-form input {
    flex: 1;
}

.btn-submit-ranking {
    background: linear-gradient(135deg, #0be881 0%, #05c46b 100%);
    color: #fff;
    font-weight: bold;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
    border: 1px solid #75f0b5;
}

.btn-submit-ranking:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(11, 232, 129, 0.4);
}

.btn-submit-ranking:disabled {
    background: #34495e;
    border-color: #4b537c;
    cursor: not-allowed;
}

/* タブナビ */
.ranking-tabs-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.ranking-tab-btn {
    flex: 1;
    background: #1e2338;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: bold;
}

.ranking-tab-btn.active-tab {
    background: linear-gradient(135deg, #3c40c6 0%, #575fcf 100%);
    color: #fff;
    border-color: #7ed6df;
    box-shadow: 0 4px 12px rgba(60, 64, 198, 0.35);
}

.ranking-list-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.ranking-status-msg {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.ranking-status-msg.error {
    color: #ff6b6b;
}

.ranking-row {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
}

.ranking-row:hover {
    background: var(--bg-card-secondary);
    transform: translateX(3px);
}

.ranking-rank {
    width: 60px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
}

.rank-gold {
    border-color: #f1c40f;
    background: linear-gradient(90deg, rgba(241, 196, 15, 0.15) 0%, var(--bg-card) 100%);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.2);
}

.rank-gold .ranking-rank {
    color: #f1c40f;
    font-size: 1.25rem;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.6);
}

.rank-silver {
    border-color: #bdc3c7;
    background: linear-gradient(90deg, rgba(189, 195, 199, 0.15) 0%, var(--bg-card) 100%);
}

.rank-silver .ranking-rank {
    color: #d2dae2;
    font-size: 1.2rem;
}

.rank-bronze {
    border-color: #e67e22;
    background: linear-gradient(90deg, rgba(230, 126, 34, 0.15) 0%, var(--bg-card) 100%);
}

.rank-bronze .ranking-rank {
    color: #e67e22;
    font-size: 1.15rem;
}

.ranking-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ranking-name {
    font-size: 1.05rem;
    font-weight: bold;
    color: #fff;
}

.ranking-sub-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ranking-main-stat {
    text-align: right;
}

.stat-highlight {
    font-size: 1.35rem;
    font-weight: 900;
}

.combo-highlight {
    color: #ff7675;
    text-shadow: 0 0 8px rgba(255, 118, 117, 0.4);
}

.score-highlight {
    color: #f1c40f;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.4);
}

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

.stat-sub-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* スマホ/タブレット向けレスポンシブ */
@media (max-width: 650px) {
    #game-container {
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    .battle-arena {
        grid-template-columns: 1fr;
        height: 52%;
    }
    .options-grid {
        grid-template-columns: 1fr;
    }
    .status-content-wrapper {
        grid-template-columns: 1fr;
    }
    .title-main {
        font-size: 2.1rem;
    }
    .my-score-form {
        flex-direction: column;
    }
    .my-score-stats {
        grid-template-columns: 1fr;
    }
}
