/* gNovel Games - Frontend Styles */

.gnovel-games-container {
    font-family: 'Hiragino Kaku Gothic Pro', 'Meiryo', sans-serif;
    position: relative;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.novel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #fff;
    font-size: 18px;
}

.novel-game-canvas {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

/* 背景レイヤー */
.novel-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: opacity 0.5s ease-in-out;
}

.novel-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* キャラクターレイヤー */
.novel-characters {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.novel-character {
    position: absolute;
    bottom: 0;
    height: 80%;
    transition: all 0.3s ease-in-out;
    opacity: 0;
}

.novel-character.active {
    opacity: 1;
}

.novel-character img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.novel-character.left {
    left: 10%;
}

.novel-character.center {
    left: 50%;
    transform: translateX(-50%);
}

.novel-character.right {
    right: 10%;
}

/* テキストボックス */
.novel-textbox {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.85);
    padding: 20px 30px;
    min-height: 150px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.novel-textbox.narrator {
    background: rgba(20, 20, 40, 0.9);
}

.novel-character-name {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.novel-text {
    color: #fff;
    font-size: 16px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.novel-text.narrator {
    color: #e0e0e0;
    font-style: italic;
}

/* 選択肢 */
.novel-choices {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-width: 400px;
}

.novel-choice {
    display: block;
    width: 100%;
    padding: 15px 20px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.novel-choice:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateX(5px);
}

.novel-choice:active {
    background: rgba(255, 255, 255, 0.3);
}

/* クリック進行インジケーター */
.novel-continue-indicator {
    position: absolute;
    bottom: 30px;
    right: 30px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .novel-textbox {
        padding: 15px 20px;
        min-height: 120px;
    }
    
    .novel-character-name {
        font-size: 16px;
    }
    
    .novel-text {
        font-size: 14px;
    }
    
    .novel-choices {
        min-width: 90%;
        padding: 20px;
    }
    
    .novel-choice {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* フェードイン・アウト */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

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

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

/* システムログスタイル */
.novel-textbox.system-log {
    background: rgba(0, 40, 60, 0.95);
    border-top: 2px solid #7EBEA5;
}

.novel-text.system-log-text {
    color: #7EBEA5;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 1px;
}

/* 通知スタイル */
.novel-notification {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-50px);
    z-index: 30;
    background: rgba(126, 190, 165, 0.95);
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 0.3s ease;
}

.novel-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* エフェクト: フラッシュ */
@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; background: #fff; }
}

/* エフェクト: シェイク */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* エフェクト: グリッチ */
.glitch-effect {
    animation: glitch 0.3s infinite;
}

@keyframes glitch {
    0% {
        text-shadow: 2px 2px #ff00de, -2px -2px #00ffff;
        transform: translate(0);
    }
    25% {
        text-shadow: -2px 2px #ff00de, 2px -2px #00ffff;
        transform: translate(-2px, 2px);
    }
    50% {
        text-shadow: 2px -2px #ff00de, -2px 2px #00ffff;
        transform: translate(2px, -2px);
    }
    75% {
        text-shadow: -2px -2px #ff00de, 2px 2px #00ffff;
        transform: translate(-2px, -2px);
    }
    100% {
        text-shadow: 2px 2px #ff00de, -2px -2px #00ffff;
        transform: translate(0);
    }
}

/* 青磁色テーマ */
.novel-theme-celadon {
    border-color: #7EBEA5;
}

.novel-theme-celadon .novel-textbox {
    border-top-color: #7EBEA5;
}

.novel-theme-celadon .novel-choice {
    border-color: #7EBEA5;
}

.novel-theme-celadon .novel-choice:hover {
    background: rgba(126, 190, 165, 0.2);
    border-color: #7EBEA5;
}
