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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Arial', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

.game-container {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* スクリーン管理 */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* タイトル画面 */
.game-title {
    text-align: center;
    margin-bottom: 20px;
}

.title-main {
    display: block;
    font-size: 3em;
    font-weight: bold;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(240, 147, 251, 0.5);
    margin-bottom: 10px;
}

.title-sub {
    display: block;
    font-size: 1.2em;
    color: #a0a0a0;
    letter-spacing: 4px;
}

.game-description {
    text-align: center;
    font-size: 1.1em;
    line-height: 1.8;
    color: #d0d0d0;
    margin-bottom: 40px;
}

/* キャラクター選択 */
.character-selection h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 30px;
    color: #ffd43b;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

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

.character-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 15px;
    align-items: center;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.character-card:hover {
    transform: translateY(-5px);
    border-color: #ffd43b;
    box-shadow: 0 10px 30px rgba(255, 212, 59, 0.3);
}

.character-card:hover::before {
    opacity: 1;
}

.char-image-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.char-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 画像が読み込めない場合のフォールバック */
.char-image-placeholder:not(:has(img[src*=".png"])) {
    font-size: 3em;
}

.char-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.char-name {
    font-size: 1.4em;
    font-weight: bold;
    color: #fff;
    margin: 0;
}

.char-element {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: bold;
    align-self: flex-start;
}

.char-element.fire {
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
}

.char-element.water {
    background: linear-gradient(135deg, #4dabf7, #228be6);
}

.char-element.wood {
    background: linear-gradient(135deg, #51cf66, #37b24d);
}

.char-element.light {
    background: linear-gradient(135deg, #ffd700, #fff59d);
    color: #333;
}

.char-element.dark {
    background: linear-gradient(135deg, #2c2c3e, #1a1a2e);
    color: #fff;
}

.char-skill {
    font-size: 0.95em;
    color: #b0b0b0;
    font-weight: 500;
}

/* バトル画面 */
.battle-arena {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    gap: 30px;
    min-height: 500px;
    margin-bottom: 30px;
}

.battle-character {
    display: flex;
    justify-content: center;
    align-items: center;
}

.battle-character.enemy {
    transform: scaleX(-1);
}

.battle-character.enemy .char-display {
    transform: scaleX(-1);
}

.char-display {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 500px;
}

.char-portrait {
    width: 150px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
    position: relative;
}

.char-portrait img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 吹き出し */
.speech-bubble {
    display: none;
    position: absolute;
    bottom: 30px;
    right: -20px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 1.1em;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    animation: speechPop 0.3s ease-out;
}

.speech-bubble.active {
    display: block;
}

/* 吹き出しの尻尾 */
.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: -10px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid rgba(255, 255, 255, 0.95);
}

/* 攻撃時の吹き出し（赤系） */
.speech-bubble.attack {
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    color: #fff;
}

.speech-bubble.attack::after {
    border-right-color: #ff4444;
}

/* ダメージ時の吹き出し（青系） */
.speech-bubble.damage {
    background: linear-gradient(135deg, #4dabf7, #228be6);
    color: #fff;
}

.speech-bubble.damage::after {
    border-right-color: #228be6;
}

@keyframes speechPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.char-status {
    flex: 1;
}

.char-name-battle {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #ffd43b;
}

.hp-container {
    margin-bottom: 10px;
}

.hp-label {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-bottom: 5px;
}

.hp-bar-bg {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 5px;
}

.hp-bar {
    height: 100%;
    background: linear-gradient(90deg, #51cf66, #37b24d);
    transition: width 0.5s ease, background 0.3s ease;
    border-radius: 13px;
}

.hp-bar.low {
    background: linear-gradient(90deg, #ffd43b, #fcc419);
}

.hp-bar.critical {
    background: linear-gradient(90deg, #ff6b6b, #ff4444);
}

.hp-text {
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
}

.element-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 10px;
}

/* バトルメッセージ */
.battle-message {
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    padding: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 212, 59, 0.5);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1s ease-in-out;
}

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

/* アクションパネル */
.action-panel {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
}

.special-buttons-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    flex: 0 1 auto;
    min-width: 180px;
    max-width: 250px;
    padding: 20px;
    border: 3px solid;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.action-btn.normal {
    border-color: #4dabf7;
}

.action-btn.normal:hover {
    background: rgba(77, 171, 247, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(77, 171, 247, 0.3);
}

.action-btn.special {
    border-color: #ff6b6b;
}

.action-btn.special:hover {
    background: rgba(255, 107, 107, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.action-btn.ultimate {
    border-color: #ffd43b;
    background: linear-gradient(135deg, rgba(255, 212, 59, 0.1), rgba(255, 107, 107, 0.1));
    position: relative;
    overflow: hidden;
}

.action-btn.ultimate::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 212, 59, 0.3), transparent);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%);
    }
    100% {
        transform: translateX(100%) translateY(100%);
    }
}

.action-btn.ultimate:hover {
    background: linear-gradient(135deg, rgba(255, 212, 59, 0.3), rgba(255, 107, 107, 0.2));
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(255, 212, 59, 0.5);
}

.action-btn.ultimate .btn-text::after {
    content: ' 奥義';
    font-size: 0.7em;
    color: #ffd43b;
    margin-left: 5px;
}

.action-btn.escape {
    border-color: #868e96;
}

.action-btn.escape:hover {
    background: rgba(134, 142, 150, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(134, 142, 150, 0.3);
}

.action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(1);
    position: relative;
}

.action-btn:disabled::after {
    content: '待機中...';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: #aaa;
    white-space: nowrap;
}

.action-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    font-size: 2em;
}

.btn-text {
    font-weight: bold;
    font-size: 1.2em;
}

.btn-desc {
    font-size: 0.8em;
    color: #a0a0a0;
}

/* 結果画面 */
.result-title {
    text-align: center;
    font-size: 3em;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #ffd43b, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.result-stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.result-label {
    display: block;
    font-size: 1em;
    color: #a0a0a0;
    margin-bottom: 10px;
}

.result-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #ffd43b;
}

.result-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.retry-btn,
.back-btn {
    padding: 15px 40px;
    font-size: 1.2em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.retry-btn {
    background: linear-gradient(135deg, #51cf66, #37b24d);
    color: #fff;
}

.retry-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(81, 207, 102, 0.4);
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* キャラクター確認画面 */
.confirm-title {
    text-align: center;
    font-size: 2em;
    margin-bottom: 30px;
    color: #ffd43b;
}

.confirm-container {
    max-width: 800px;
    margin: 0 auto;
}

.confirm-character {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .confirm-character {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.confirm-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.confirm-image img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
}

.confirm-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.confirm-char-name {
    font-size: 2.2em;
    margin: 0;
    color: #ffd43b;
}

.confirm-info .char-element {
    display: inline-block;
    align-self: flex-start;
}

.confirm-stats {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 1.1em;
}

.stat-label {
    color: #a0a0a0;
}

.stat-value {
    color: #ffd43b;
    font-weight: bold;
}

.confirm-specials {
    margin-top: 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.specials-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    margin-top: 0;
    color: #ffd43b;
    text-align: left;
}

.special-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.special-item {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 68, 68, 0.2));
    border: 2px solid rgba(255, 107, 107, 0.4);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.special-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #ff6b6b;
}

.special-stats {
    font-size: 0.9em;
    color: #a0a0a0;
}

.confirm-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.confirm-btn {
    padding: 20px 60px;
    font-size: 1.4em;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 200px;
}

.confirm-btn.primary {
    background: linear-gradient(135deg, #51cf66, #37b24d);
    color: #fff;
}

.confirm-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(81, 207, 102, 0.4);
}

.confirm-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.confirm-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .title-main {
        font-size: 2em;
    }

    .character-grid {
        grid-template-columns: 1fr;
    }

    .char-display {
        min-width: auto;
        flex-direction: column;
    }

    .action-panel {
        flex-direction: column;
    }

    .action-btn {
        max-width: 100%;
    }

    .result-buttons {
        flex-direction: column;
    }
}

/* 奥義エフェクト */
.ultimate-effect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.ultimate-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 212, 59, 0.8) 0%, transparent 70%);
    animation: flash 0.5s ease-out;
}

@keyframes flash {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

.ultimate-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #ffd43b, #ff6b6b);
    border-radius: 50%;
    top: 0;
    left: 0;
    animation: particle-burst 1.5s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes particle-burst {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(300px) scale(0);
    }
}

.ultimate-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    font-weight: bold;
    color: #ffd43b;
    text-shadow: 0 0 20px rgba(255, 212, 59, 0.8),
                 0 0 40px rgba(255, 107, 107, 0.6),
                 0 0 60px rgba(255, 212, 59, 0.4);
    animation: ultimate-text-appear 2s ease-out;
    white-space: nowrap;
}

@keyframes ultimate-text-appear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    40% {
        transform: translate(-50%, -50%) scale(1);
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* =====================================================
   スマートフォン最適化（480px以下）
   ===================================================== */
@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }

    .title-main {
        font-size: 1.5em;
    }

    .title-sub {
        font-size: 0.9em;
        letter-spacing: 2px;
    }

    .game-description {
        font-size: 0.9em;
        margin-bottom: 20px;
    }

    .character-selection h2 {
        font-size: 1.5em;
    }

    .character-card {
        grid-template-columns: 100px 1fr;
        padding: 10px;
        gap: 10px;
    }

    .char-image-placeholder {
        width: 100px;
        height: 100px;
    }

    .char-name {
        font-size: 1.1em;
    }

    .char-element {
        font-size: 0.85em;
        padding: 4px 10px;
    }

    .char-skill {
        font-size: 0.85em;
    }

    /* バトル画面 */
    .battle-arena {
        gap: 15px;
        min-height: auto;
    }

    .char-display {
        padding: 10px;
        gap: 10px;
    }

    .char-portrait {
        width: 80px;
        height: 100px;
    }

    .char-name-battle {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .hp-bar-bg {
        height: 20px;
    }

    .hp-text {
        font-size: 0.9em;
    }

    .element-badge {
        font-size: 0.9em;
        padding: 4px 10px;
    }

    .battle-message {
        font-size: 1em;
        padding: 10px;
        min-height: 60px;
    }

    /* アクションボタン */
    .action-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 15px;
        font-size: 0.95em;
    }

    .btn-icon {
        font-size: 1.5em;
    }

    .btn-text {
        font-size: 1em;
    }

    .btn-desc {
        font-size: 0.7em;
    }

    /* 吹き出し */
    .speech-bubble {
        font-size: 0.85em;
        padding: 8px 12px;
        bottom: 20px;
        right: -10px;
    }

    /* 結果画面 */
    .result-title {
        font-size: 2em;
    }

    .result-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .result-stat {
        padding: 15px 10px;
    }

    .result-value {
        font-size: 1.5em;
    }

    .retry-btn,
    .back-btn {
        padding: 12px 30px;
        font-size: 1em;
    }

    /* 確認画面 */
    .confirm-title {
        font-size: 1.5em;
    }

    .confirm-character {
        padding: 15px;
    }

    .confirm-char-name {
        font-size: 1.6em;
    }

    .confirm-btn {
        padding: 15px 30px;
        font-size: 1.1em;
        min-width: 150px;
    }

    /* 奥義エフェクト */
    .ultimate-text {
        font-size: 2em;
    }
}

/* =====================================================
   トーナメント画面スタイル
   ===================================================== */

/* トーナメント開始画面 */
.tournament-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #ffd43b, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 212, 59, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.8)); }
}

.tournament-intro {
    max-width: 800px;
    margin: 0 auto 40px;
}

.tournament-description {
    text-align: center;
    font-size: 1.2em;
    line-height: 1.8;
    color: #d0d0d0;
    margin-bottom: 40px;
}

.tournament-structure {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.round-preview {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    min-width: 150px;
    transition: all 0.3s ease;
}

.round-preview:hover {
    transform: translateY(-5px);
    border-color: #ffd43b;
    box-shadow: 0 10px 30px rgba(255, 212, 59, 0.3);
}

.round-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.round-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffd43b;
}

.round-battles {
    font-size: 1em;
    color: #a0a0a0;
}

.round-arrow {
    font-size: 2em;
    color: #ffd43b;
}

.tournament-btn {
    display: block;
    margin: 0 auto;
    padding: 20px 60px;
    font-size: 1.4em;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #ff6b6b, #ffd43b);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 212, 59, 0.4);
}

.tournament-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(255, 212, 59, 0.6);
}

.tournament-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tournament-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ラウンド開始演出画面 */
#round-start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.round-banner {
    text-align: center;
    animation: roundBannerAppear 2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes roundBannerAppear {
    0% {
        transform: scale(3) rotate(10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(-5deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.round-number {
    font-size: 5em;
    font-weight: bold;
    background: linear-gradient(135deg, #ffd43b, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 212, 59, 0.8);
    margin-bottom: 20px;
    animation: pulse 1s ease-in-out infinite;
}

.round-name-display {
    font-size: 2.5em;
    color: #ffd43b;
    font-weight: bold;
}

/* VS画面 */
#vs-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.vs-container {
    display: flex;
    align-items: center;
    gap: 50px;
    animation: fadeIn 0.5s ease-in;
}

.vs-character {
    text-align: center;
    animation: vsSlideIn 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vs-character.vs-player {
    animation-name: vsSlideInLeft;
}

.vs-character.vs-enemy {
    animation-name: vsSlideInRight;
}

@keyframes vsSlideInLeft {
    0% {
        transform: translateX(-200px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes vsSlideInRight {
    0% {
        transform: translateX(200px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.vs-character img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #ffd43b;
    box-shadow: 0 0 30px rgba(255, 212, 59, 0.6);
    margin-bottom: 20px;
}

.vs-char-name {
    font-size: 1.8em;
    font-weight: bold;
    color: #ffd43b;
}

.vs-text {
    font-size: 5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 30px rgba(255, 212, 59, 0.8);
    animation: vsPulse 1s ease-in-out infinite;
}

@keyframes vsPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 212, 59, 0.8));
    }
    50% {
        transform: scale(1.2);
        filter: drop-shadow(0 0 40px rgba(255, 107, 107, 1));
    }
}

/* ラウンド休憩画面 */
.rest-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #51cf66;
    animation: fadeIn 0.5s ease-in;
}

.rest-container {
    max-width: 600px;
    margin: 0 auto 40px;
}

.rest-message {
    text-align: center;
    font-size: 1.3em;
    margin-bottom: 30px;
}

.rest-message p {
    margin: 15px 0;
    color: #d0d0d0;
}

.rest-healing {
    color: #51cf66;
    font-weight: bold;
    animation: healingGlow 1.5s ease-in-out infinite;
}

@keyframes healingGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(81, 207, 102, 0.5); }
    50% { text-shadow: 0 0 20px rgba(81, 207, 102, 1); }
}

.rest-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.rest-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.rest-label {
    display: block;
    font-size: 0.9em;
    color: #a0a0a0;
    margin-bottom: 10px;
}

.rest-value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #ffd43b;
}

.rest-value.healing {
    color: #51cf66;
}

/* トーナメント完走画面 */
.tournament-complete-title {
    text-align: center;
    font-size: 3em;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #ffd43b, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: championGlow 2s ease-in-out infinite;
}

@keyframes championGlow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 212, 59, 0.8)); }
    50% { filter: drop-shadow(0 0 40px rgba(255, 107, 107, 1)); }
}

.champion-container {
    max-width: 600px;
    margin: 0 auto 40px;
    text-align: center;
}

.trophy-icon {
    font-size: 8em;
    animation: trophyBounce 2s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes trophyBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.champion-name {
    font-size: 2.5em;
    font-weight: bold;
    color: #ffd43b;
    margin-bottom: 30px;
}

.champion-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.champion-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.tournament-complete-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* スマホ対応 - トーナメント画面 */
@media (max-width: 480px) {
    .tournament-title {
        font-size: 1.8em;
    }

    .tournament-description {
        font-size: 1em;
    }

    .tournament-structure {
        flex-direction: column;
        gap: 10px;
    }

    .round-arrow {
        transform: rotate(90deg);
        font-size: 1.5em;
    }

    .round-preview {
        min-width: 100%;
        padding: 15px;
    }

    .round-icon {
        font-size: 2em;
    }

    .round-name {
        font-size: 1em;
    }

    .tournament-btn {
        padding: 15px 30px;
        font-size: 1.1em;
    }

    .round-number {
        font-size: 3em;
    }

    .round-name-display {
        font-size: 1.5em;
    }

    .vs-container {
        flex-direction: column;
        gap: 20px;
    }

    .vs-character img {
        width: 120px;
        height: 120px;
    }

    .vs-char-name {
        font-size: 1.3em;
    }

    .vs-text {
        font-size: 3em;
    }

    .rest-title {
        font-size: 1.8em;
    }

    .rest-message {
        font-size: 1em;
    }

    .rest-stats {
        grid-template-columns: 1fr;
    }

    .tournament-complete-title {
        font-size: 2em;
    }

    .trophy-icon {
        font-size: 5em;
    }

    .champion-name {
        font-size: 1.8em;
    }

    .champion-stats {
        grid-template-columns: 1fr;
    }

    .tournament-complete-buttons {
        flex-direction: column;
    }

    .tournament-complete-buttons .tournament-btn {
        width: 100%;
    }
}

/* =====================================================
   Phase 3: 追加演出エフェクト
   ===================================================== */

/* カットイン演出（必殺技時） */
.cutin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: cutinFadeIn 0.2s ease-out;
    pointer-events: none;
}

@keyframes cutinFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cutin-character {
    width: 400px;
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 10px solid #ffd43b;
    box-shadow: 0 0 60px rgba(255, 212, 59, 1);
    animation: cutinZoom 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cutinZoom {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.cutin-skill-name {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 30px rgba(255, 212, 59, 1),
                 0 0 60px rgba(255, 107, 107, 1);
    animation: cutinTextSlide 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

@keyframes cutinTextSlide {
    0% {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.cutin-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    animation: cutinFlash 0.3s ease-out;
}

@keyframes cutinFlash {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* 勝利演出（紙吹雪・花火） */
.victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1500;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #ffd43b;
    animation: confettiFall var(--fall-duration, 3s) linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0.5;
    }
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: fireworkExplode 1s ease-out forwards;
}

@keyframes fireworkExplode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* HP回復演出（パーティクル・キラキラ） */
.heal-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.heal-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #51cf66 0%, #51cf66 50%, transparent 100%);
    border-radius: 50%;
    animation: healParticleRise var(--rise-duration, 2s) ease-out forwards;
    opacity: 0;
}

@keyframes healParticleRise {
    0% {
        transform: translateY(0) translateX(var(--tx, 0)) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(var(--tx, 0)) scale(1.5);
        opacity: 0;
    }
}

.heal-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(81, 207, 102, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: healGlowPulse 1s ease-out;
}

@keyframes healGlowPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* 連勝ボーナス演出 */
.combo-overlay {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1800;
    text-align: center;
    pointer-events: none;
}

.combo-count {
    font-size: 5em;
    font-weight: bold;
    color: #ffd43b;
    text-shadow: 0 0 30px rgba(255, 212, 59, 1),
                 0 0 60px rgba(255, 107, 107, 1);
    animation: comboCountAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes comboCountAppear {
    0% {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.combo-text {
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 212, 59, 0.8);
    margin-top: 10px;
    animation: comboTextSlide 0.5s ease-out 0.2s backwards;
}

@keyframes comboTextSlide {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.combo-bonus {
    font-size: 1.8em;
    color: #51cf66;
    margin-top: 15px;
    animation: comboBonusGlow 1s ease-out 0.4s backwards;
}

@keyframes comboBonusGlow {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 隠しボス解放演出 */
.secret-boss-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 2500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: secretBossAppear 2s ease-out;
    pointer-events: none;
}

@keyframes secretBossAppear {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.secret-boss-warning {
    font-size: 3em;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 0 0 40px rgba(255, 107, 107, 1),
                 0 0 80px rgba(255, 0, 0, 1);
    animation: secretBossWarning 0.5s ease-in-out infinite;
    margin-bottom: 30px;
}

@keyframes secretBossWarning {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.secret-boss-silhouette {
    width: 300px;
    height: 300px;
    background: #000;
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(255, 0, 0, 0.8),
                inset 0 0 60px rgba(255, 0, 0, 0.5);
    animation: secretBossPulse 2s ease-in-out infinite;
    margin-bottom: 30px;
}

@keyframes secretBossPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 60px rgba(255, 0, 0, 0.8),
                    inset 0 0 60px rgba(255, 0, 0, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 100px rgba(255, 0, 0, 1),
                    inset 0 0 100px rgba(255, 0, 0, 0.8);
    }
}

.secret-boss-name {
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 30px rgba(255, 107, 107, 1);
    animation: secretBossNameReveal 1s ease-out 1s backwards;
}

@keyframes secretBossNameReveal {
    0% {
        transform: translateY(30px);
        opacity: 0;
        filter: blur(10px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

/* スマホ対応 - Phase 3演出 */
@media (max-width: 480px) {
    .cutin-character {
        width: 250px;
        height: 250px;
    }

    .cutin-skill-name {
        font-size: 2em;
    }

    .combo-count {
        font-size: 3em;
    }

    .combo-text {
        font-size: 1.8em;
    }

    .combo-bonus {
        font-size: 1.3em;
    }

    .secret-boss-warning {
        font-size: 2em;
    }

    .secret-boss-silhouette {
        width: 200px;
        height: 200px;
    }

    .secret-boss-name {
        font-size: 1.8em;
    }
}

/* BGM・SE用のコメント指示
 * ===================================================
 * BGM再生タイミング（実装時は HTMLAudioElement を使用）:
 *
 * 1. タイトル画面: bgm_title.mp3（ループ）
 * 2. キャラ選択: bgm_select.mp3（ループ）
 * 3. トーナメント開始: se_tournament_start.mp3（1回）
 * 4. ラウンド開始: se_round_start.mp3（1回）
 * 5. VS画面: se_vs.mp3（1回）
 * 6. バトル中: bgm_battle.mp3（ループ）
 * 7. 通常攻撃: se_attack.mp3（1回）
 * 8. 必殺技: se_special.mp3（1回）
 * 9. 奥義: se_ultimate.mp3（1回）+ カットイン
 * 10. ダメージ受け: se_damage.mp3（1回）
 * 11. HP回復: se_heal.mp3（1回）+ パーティクル
 * 12. バトル勝利: se_win.mp3（1回）+ 紙吹雪
 * 13. トーナメント優勝: bgm_victory.mp3（ループ）+ 花火
 * 14. 敗北: se_lose.mp3（1回）
 * 15. 隠しボス登場: se_secret_boss.mp3（1回）+ 演出
 * 16. 連勝ボーナス: se_combo.mp3（1回）+ 演出
 *
 * 実装例:
 * const bgmTitle = new Audio('sounds/bgm_title.mp3');
 * bgmTitle.loop = true;
 * bgmTitle.volume = 0.5;
 * bgmTitle.play();
 *
 * const seAttack = new Audio('sounds/se_attack.mp3');
 * seAttack.volume = 0.7;
 * seAttack.play();
 *
 * 注意: 音声ファイルは sounds/ ディレクトリに配置すること
 * ===================================================
 */
