/**
 * Company Quest フロントエンドスタイル
 * RPGツクール風の演出を追加
 */

.cq-container {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'MS PGothic', 'MS Gothic', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', sans-serif;
    line-height: 1.6;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
    background: #1a1a2e;
}

/* 全画面モード時のbody調整 */
body.cq-fullscreen {
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* 背景エフェクト */
.cq-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 115, 170, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 115, 170, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: backgroundPulse 8s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.cq-scene {
    position: relative;
    animation: sceneEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

@keyframes sceneEnter {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* 画面フラッシュエフェクト */
.cq-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    pointer-events: none;
    animation: flashEffect 0.3s ease-out;
}

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

/* シャッターエフェクト */
.cq-shutter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9998;
    pointer-events: none;
    transform: translateY(-100%);
    animation: shutterClose 0.4s ease-in, shutterOpen 0.4s ease-out 0.4s;
}

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

@keyframes shutterOpen {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .cq-scene {
        animation: none;
    }
}

/* RPG風メッセージウィンドウ */
.cq-text {
    font-size: 1.3em;
    margin: 2em;
    padding: 2em 2.5em;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 4px solid #2c3e50;
    border-radius: 12px;
    line-height: 2;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    animation: messageWindowAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 120px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.cq-text::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(0, 115, 170, 0.3) 0%,
        rgba(0, 115, 170, 0.1) 50%,
        rgba(0, 115, 170, 0.3) 100%);
    border-radius: 12px;
    z-index: -1;
    animation: borderGlow 2s ease-in-out infinite;
}

@keyframes messageWindowAppear {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* タイピングアニメーション用 */
.cq-text.typing::after {
    content: '▊';
    animation: cursorBlink 1s infinite;
    color: var(--cq-primary-color, #0073aa);
    font-weight: bold;
    margin-left: 4px;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* RPG風選択肢 */
.cq-choices {
    display: flex;
    flex-direction: column;
    gap: 1.2em;
    margin-top: 2em;
    animation: choicesAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

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

.cq-choice {
    padding: 1.2em 2em;
    font-size: 1.1em;
    background: linear-gradient(135deg, 
        var(--cq-primary-color, #0073aa) 0%,
        var(--cq-primary-color-dark, #005a87) 100%);
    color: #fff;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cq-choice::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    transition: left 0.5s;
}

.cq-choice:hover::before {
    left: 100%;
}

.cq-choice::after {
    content: '▶';
    position: absolute;
    left: 1em;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s;
    font-size: 0.8em;
}

.cq-choice:hover::after,
.cq-choice:focus::after {
    opacity: 1;
    left: 0.5em;
}

.cq-choice:hover {
    background: linear-gradient(135deg, 
        var(--cq-primary-color-dark, #005a87) 0%,
        var(--cq-primary-color, #0073aa) 100%);
    transform: translateX(10px) scale(1.02);
    box-shadow: 
        0 6px 20px rgba(0, 115, 170, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 20px rgba(0, 115, 170, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.cq-choice:focus {
    outline: none;
    box-shadow: 
        0 0 0 3px rgba(0, 115, 170, 0.5),
        0 6px 20px rgba(0, 115, 170, 0.4);
}

.cq-choice:active {
    transform: translateX(5px) scale(0.98);
    box-shadow: 
        0 2px 8px rgba(0, 115, 170, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cq-choice.selected {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-color: #ffd700;
    color: #2c3e50;
    text-shadow: none;
    animation: choicePulse 0.5s ease-in-out;
}

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

@media (prefers-reduced-motion: reduce) {
    .cq-choice {
        transition: none;
    }
    .cq-choice:hover {
        transform: none;
    }
}

/* RPG風カード */
.cq-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2em;
    margin-top: 2em;
    perspective: 1000px;
}

.cq-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 3px solid #2c3e50;
    border-radius: 12px;
    padding: 2em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: cardAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
    transform-style: preserve-3d;
}

.cq-card:nth-child(1) { animation-delay: 0.1s; }
.cq-card:nth-child(2) { animation-delay: 0.2s; }
.cq-card:nth-child(3) { animation-delay: 0.3s; }
.cq-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(50px) rotateX(-15deg) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
    }
}

.cq-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0, 115, 170, 0.1) 0%,
        transparent 50%,
        rgba(0, 115, 170, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

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

.cq-card:hover {
    border-color: var(--cq-primary-color, #0073aa);
    box-shadow: 
        0 12px 32px rgba(0, 115, 170, 0.3),
        0 0 40px rgba(0, 115, 170, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-8px) rotateX(5deg) scale(1.03);
    border-width: 4px;
}

.cq-card:focus {
    outline: none;
    box-shadow: 
        0 0 0 4px rgba(0, 115, 170, 0.5),
        0 12px 32px rgba(0, 115, 170, 0.3);
}

.cq-card:active {
    transform: translateY(-4px) scale(0.98);
}

.cq-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.2em;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.cq-card:hover img {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.cq-card-title {
    font-size: 1.4em;
    margin: 0 0 0.8em 0;
    color: #2c3e50;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    padding-bottom: 0.5em;
}

.cq-card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--cq-primary-color, #0073aa),
        transparent);
    border-radius: 2px;
}

.cq-card-desc {
    margin: 0;
    color: #555;
    flex-grow: 1;
    line-height: 1.7;
    font-size: 0.95em;
}

@media (prefers-reduced-motion: reduce) {
    .cq-card {
        transition: none;
    }
    .cq-card:hover {
        transform: none;
    }
}

/* エンド画面 */
.cq-end {
    text-align: center;
    padding: 3em 0;
    animation: endAppear 1s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cq-cta {
    display: flex;
    gap: 1em;
    justify-content: center;
    margin-top: 2em;
    flex-wrap: wrap;
}

.cq-cta-button {
    display: inline-block;
    padding: 1.2em 2.5em;
    background: linear-gradient(135deg, 
        var(--cq-primary-color, #0073aa) 0%,
        var(--cq-primary-color-dark, #005a87) 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.1em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 6px 16px rgba(0, 115, 170, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    animation: ctaAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.cq-cta-button:nth-child(1) { animation-delay: 0.2s; }
.cq-cta-button:nth-child(2) { animation-delay: 0.4s; }

@keyframes ctaAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cq-cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent);
    transition: left 0.5s;
}

.cq-cta-button:hover::before {
    left: 100%;
}

.cq-cta-button:hover {
    background: linear-gradient(135deg, 
        var(--cq-primary-color-dark, #005a87) 0%,
        var(--cq-primary-color, #0073aa) 100%);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 10px 24px rgba(0, 115, 170, 0.4),
        0 0 30px rgba(0, 115, 170, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}

.cq-cta-button:active {
    transform: translateY(-2px) scale(1.02);
}

.cq-cta-button:focus {
    outline: 2px solid var(--cq-primary-color, #0073aa);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .cq-cta-button {
        transition: none;
    }
    .cq-cta-button:hover {
        transform: none;
    }
}

/* エラー表示 */
.cq-error {
    padding: 2em;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    color: #c33;
    text-align: center;
}

/* パーティクルエフェクト（JSで動的に追加される） */

/* キーボード操作時のフォーカスリング */
.cq-choice:focus-visible,
.cq-card:focus-visible,
.cq-cta-button:focus-visible {
    outline: 3px solid var(--cq-primary-color, #0073aa);
    outline-offset: 3px;
    animation: focusPulse 1.5s ease-in-out infinite;
}

@keyframes focusPulse {
    0%, 100% {
        outline-width: 3px;
        outline-color: var(--cq-primary-color, #0073aa);
    }
    50% {
        outline-width: 4px;
        outline-color: rgba(0, 115, 170, 0.6);
    }
}

/* ローディングエフェクト */
.cq-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 115, 170, 0.2);
    border-top-color: var(--cq-primary-color, #0073aa);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 2em auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* マップシーン */
.cq-map-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #2c3e50;
    border: none;
    border-radius: 0;
    overflow: hidden;
    margin: 0;
}

.cq-map-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.7;
}

.cq-map-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.cq-map-player {
    position: absolute;
    width: 32px;
    height: 32px;
    background: #3498db;
    border: 2px solid #2980b9;
    border-radius: 4px;
    z-index: 10;
    transition: none; /* スムーズな移動のためtransitionを無効化 */
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
    animation: playerPulse 2s ease-in-out infinite;
    transform: translate(-50%, -50%); /* 中心点を基準に配置 */
}

@keyframes playerPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(52, 152, 219, 0.5); }
    50% { box-shadow: 0 0 20px rgba(52, 152, 219, 0.8); }
}

.cq-map-npc {
    position: absolute;
    width: 32px;
    height: 32px;
    background: #e74c3c;
    border: 2px solid #c0392b;
    border-radius: 4px;
    z-index: 5;
    cursor: pointer;
    transition: all 0.2s;
    background-size: cover;
    background-position: center;
}

.cq-map-npc:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
    z-index: 15;
}

.cq-map-area {
    position: absolute;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}

.cq-map-area:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

/* 戦闘シーン */
.cq-battle-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #1a1a2e;
    border: none;
    border-radius: 0;
    overflow: hidden;
    margin: 0;
}

.cq-battle-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.5;
}

.cq-battle-enemies {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2em;
    padding: 2em;
    min-height: 300px;
    position: relative;
    z-index: 2;
}

.cq-battle-enemy {
    position: relative;
    text-align: center;
    animation: enemyAppear 0.5s ease-out;
}

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

.cq-enemy-sprite {
    width: 120px;
    height: 120px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 auto 10px;
    animation: enemyIdle 2s ease-in-out infinite;
}

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

.cq-enemy-name {
    color: #fff;
    font-weight: 600;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.cq-enemy-hp-bar {
    width: 100px;
    height: 8px;
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.cq-enemy-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    transition: width 0.3s;
}

.cq-battle-player-status {
    position: absolute;
    bottom: 120px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #0073aa;
    z-index: 10;
}

.cq-player-hp {
    color: #fff;
    min-width: 200px;
}

.cq-player-hp-bar {
    width: 100%;
    height: 12px;
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 5px;
}

.cq-player-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #229954);
    transition: width 0.3s;
}

.cq-battle-commands {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    z-index: 10;
    width: 400px;
}

.cq-battle-command {
    padding: 1em 2em;
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: #fff;
    border: 2px solid #0073aa;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.cq-battle-command:hover {
    background: linear-gradient(135deg, #0073aa, #005a87);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
}

.cq-battle-log {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    max-height: 200px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #0073aa;
    border-radius: 6px;
    padding: 10px;
    overflow-y: auto;
    z-index: 10;
}

.cq-battle-log-entry {
    color: #fff;
    font-size: 0.9em;
    margin-bottom: 5px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    transition: opacity 0.5s;
}

/* 会話シーン（タクティクスオウガ風） */
.cq-dialogue-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #1a1a2e;
    border: none;
    border-radius: 0;
    overflow: hidden;
    margin: 0;
}

.cq-dialogue-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.6;
}

.cq-dialogue-character {
    position: absolute;
    width: 40vw;
    min-width: 400px;
    max-width: 600px;
    height: 70vh;
    min-height: 500px;
    max-height: 800px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    z-index: 2;
    animation: characterAppear 0.8s ease-out;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

/* 左側のキャラクター */
.cq-dialogue-character.left,
.cq-dialogue-character[data-position="left"] {
    left: 0;
    bottom: 0;
    transform-origin: left bottom;
}

/* 右側のキャラクター */
.cq-dialogue-character.right,
.cq-dialogue-character[data-position="right"] {
    right: 0;
    bottom: 0;
    transform-origin: right bottom;
}

/* 中央のキャラクター */
.cq-dialogue-character.center,
.cq-dialogue-character[data-position="center"] {
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    transform-origin: center bottom;
}

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

.cq-dialogue-character.left,
.cq-dialogue-character[data-position="left"] {
    animation-name: characterAppearLeft;
}

.cq-dialogue-character.right,
.cq-dialogue-character[data-position="right"] {
    animation-name: characterAppearRight;
}

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

@keyframes characterAppearRight {
    0% {
        opacity: 0;
        transform: translateX(100px) translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0) scale(1);
    }
}

.cq-dialogue-name {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(20, 20, 40, 0.9));
    color: #ffd700;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.2em;
    white-space: nowrap;
    border: 2px solid #ffd700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 3;
}

.cq-dialogue-window {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75), rgba(20, 20, 40, 0.75));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-top: 4px solid #ffd700;
    padding: 2.5em 3em;
    z-index: 10;
    animation: windowSlideUp 0.5s ease-out;
    min-height: 200px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

@keyframes windowSlideUp {
    0% {
        transform: translateY(100%);
    }
    100% {
        transform: translateY(0);
    }
}

.cq-dialogue-speaker {
    color: #ffd700;
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 1.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    padding-bottom: 0.5em;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    display: inline-block;
    min-width: 200px;
}

.cq-dialogue-text {
    color: #fff;
    font-size: 1.3em;
    line-height: 2;
    min-height: 100px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
}

.cq-dialogue-text br {
    display: block;
    content: '';
    margin: 0.5em 0;
}

.cq-dialogue-actions {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 11;
}

.cq-dialogue-choice,
.cq-dialogue-next {
    padding: 0.8em 1.5em;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
    border: 2px solid #ffd700;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.cq-dialogue-choice:hover,
.cq-dialogue-next:hover {
    background: linear-gradient(135deg, #005a87, #0073aa);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 115, 170, 0.5);
}

/* 全画面モード時の調整 */
.cq-scene {
    width: 100%;
    height: 100vh;
    overflow: auto;
}

.cq-scene-message,
.cq-scene-cards {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2em;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .cq-text {
        font-size: 1.1em;
        padding: 1.5em;
        margin: 1em;
    }
    
    .cq-cards {
        grid-template-columns: 1fr;
    }
    
    .cq-choice {
        padding: 1em 1.5em;
        font-size: 1em;
    }
    
    .cq-choice::after {
        display: none; /* モバイルでは矢印を非表示 */
    }
    
    .cq-battle-commands {
        width: 90%;
        grid-template-columns: 1fr;
    }
    
    .cq-dialogue-character {
        width: 35vw;
        min-width: 300px;
        height: 60vh;
        min-height: 400px;
    }
    
    .cq-dialogue-window {
        padding: 1.5em 2em;
        min-height: 180px;
    }
    
    .cq-dialogue-speaker {
        font-size: 1.2em;
    }
    
    .cq-dialogue-text {
        font-size: 1.1em;
    }
}

/* テーマカラー適用 */
.cq-container {
    --cq-primary-color: #0073aa;
    --cq-primary-color-dark: #005a87;
}

