/* game-frame.css - ゲーム端末フレームのスタイル */
/* デバイス別のスタイルはpc-styles.cssとsp-styles.cssに分離 */

/* フレームコンテナ */
.game-frame-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.game-frame-container.visible {
    opacity: 1;
}

/* コンソール本体 - 固定サイズ */
.console-frame {
    position: relative;
    width: 1280px;
    height: 800px;
    display: flex;
    background: linear-gradient(145deg, #2a2d3a, #1a1d2a);
    border-radius: 40px;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 120px rgba(102, 126, 234, 0.2),
        inset 0 0 30px rgba(255, 255, 255, 0.03);
    transform: perspective(2000px) rotateX(1deg) rotateY(0deg);
    overflow: hidden;
}

/* 光沢効果 */
.console-frame::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        135deg,
        transparent 40%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 60%
    );
    pointer-events: none;
}

/* サイドパネル */
.side-panel-left, .side-panel-right {
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px 20px;
    z-index: 100; /* ゲーム画面より前面に */
}

.side-panel-left {
    background: linear-gradient(180deg, #667eea 0%, #5a67d8 100%);
    border-radius: 40px 0 0 40px;
}

.side-panel-right {
    background: linear-gradient(180deg, #f093fb 0%, #f5576c 100%);
    border-radius: 0 40px 40px 0;
}

/* ネオンライト効果 */
.side-panel-left::after,
.side-panel-right::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 30px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* 中央スクリーンエリア */
.screen-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1; /* 背景レイヤー */
}

/* 上部ステータスバー */
.status-bar {
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.device-name {
    font-size: 14px;
    font-weight: 400;
    font-family: 'Sawarabi Gothic', 'Noto Sans JP', sans-serif;
    color: #e2e8f0;
    letter-spacing: 0.1em;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.2),
        0 0 30px rgba(255, 255, 255, 0.1);
    animation: subtle-glow 3s ease-in-out infinite;
}

.status-indicators {
    display: flex;
    gap: 20px;
    align-items: center;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #48bb78;
    box-shadow: 0 0 10px currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* スクリーンエリア */
.screen-area {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-bezel {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 20px;
    padding: 4px;
    box-shadow: 
        inset 0 0 40px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

/* スクリーンの虹色グラデーション枠 */
.screen-bezel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c, #667eea);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradient-shift 3s ease infinite;
    opacity: 0.5;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 文字の微妙な光エフェクト */
@keyframes subtle-glow {
    0%, 100% {
        filter: brightness(1) blur(0px);
        opacity: 0.9;
    }
    50% {
        filter: brightness(1.2) blur(0.5px);
        opacity: 1;
    }
}

.screen-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    z-index: 1; /* ゲーム画面のz-indexを低く */
}

/* コントロール要素 */
.control-element {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s;
    position: relative;
    z-index: 110; /* さらに前面に */
}

/* 方向パッド（円形） */
.circular-dpad {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 20px 0;
}

.dpad-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.dpad-direction {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    z-index: 120; /* 高いz-index */
}

.dpad-direction:hover {
    background: rgba(255, 255, 255, 0.12);
}

.dpad-direction.pressed {
    background: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 
        inset 0 3px 6px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(255, 255, 255, 0.5) !important;
    transition: all 0.05s ease !important;
}

.dpad-up, .dpad-down {
    width: 30px;
    height: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.dpad-left, .dpad-right {
    width: 40px;
    height: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.dpad-up { top: 10px; }
.dpad-down { bottom: 10px; }
.dpad-left { left: 10px; }
.dpad-right { right: 10px; }

/* アナログスティック（モダンスタイル） */
.analog-stick {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 50%;
    position: relative;
    margin: 20px 0;
    box-shadow: 
        inset 0 4px 8px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(255, 255, 255, 0.1);
}

.stick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #4a5568, #2d3748);
    border-radius: 50%;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    cursor: grab;
    transition: transform 0.2s ease-out;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
    z-index: 120; /* 高いz-index */
}

.stick-knob:active {
    cursor: grabbing;
}

/* スティックを動かしているときのスタイル */
.stick-knob.dragging {
    filter: brightness(1.2);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.6),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(102, 126, 234, 0.5);
}

/* アクションボタン（ダイヤモンド配置） */
.action-buttons {
    width: 120px;
    height: 120px;
    position: relative;
    margin: 20px 0;
}

.btn-action {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.1s;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    z-index: 120; /* 高いz-index */
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.btn-action:active {
    transform: scale(0.95);
}

/* アイコンのスタイル */
.action-icon {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    transition: all 0.2s;
}

.btn-action:hover .action-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* 各ボタンのホバー時エフェクト */
.btn-north:hover {
    box-shadow: 0 0 20px rgba(109, 40, 217, 0.6);
    animation: moon-glow 2s ease-in-out infinite;
}

.btn-west:hover {
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    animation: sparkle-rotate 2s linear infinite;
}

.btn-east:hover {
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
    animation: bloom 1.5s ease-in-out infinite;
}

.btn-south:hover {
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
    animation: heartbeat 1.3s ease-in-out infinite;
}

/* アニメーション */
@keyframes moon-glow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(109, 40, 217, 0.6);
        filter: brightness(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(109, 40, 217, 0.9);
        filter: brightness(1.2);
    }
}

@keyframes sparkle-rotate {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

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

@keyframes heartbeat {
    0%, 100% { transform: translateX(-50%) scale(1); }
    25% { transform: translateX(-50%) scale(1.05); }
    50% { transform: translateX(-50%) scale(0.95); }
    75% { transform: translateX(-50%) scale(1.03); }
}

.btn-action.pressed .action-icon {
    transform: scale(0.9);
    filter: brightness(0.8) drop-shadow(0 0 8px currentColor);
}

.btn-action.pressed {
    box-shadow: 
        inset 0 4px 8px rgba(0, 0, 0, 0.6),
        0 0 20px currentColor;
    filter: brightness(0.8);
    transition: all 0.05s ease !important;
}

/* ボタンのグラデーションと配置 */
.btn-north {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #4c1d95, #6d28d9); /* 夜空の紫 */
}

.btn-north:not(.pressed) {
    transform: translateX(-50%);
}

.btn-north.pressed {
    transform: translateX(-50%);
}

.btn-south {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #ec4899, #db2777); /* ピンクのハート */
}

.btn-south:not(.pressed) {
    transform: translateX(-50%);
}

.btn-south.pressed {
    transform: translateX(-50%);
}

.btn-west {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(145deg, #fbbf24, #f59e0b); /* 星の黄色 */
}

.btn-west:not(.pressed) {
    transform: translateY(-50%);
}

.btn-west.pressed {
    transform: translateY(-50%);
}

.btn-east {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(145deg, #f472b6, #ec4899); /* 花のピンク */
}

.btn-east:not(.pressed) {
    transform: translateY(-50%);
}

.btn-east.pressed {
    transform: translateY(-50%);
}

/* ABXYボタンのtransformを強制的に維持 */
.btn-north,
.btn-north.pressed,
.btn-north:active {
    transform: translateX(-50%) !important;
}

.btn-south,
.btn-south.pressed,
.btn-south:active {
    transform: translateX(-50%) !important;
}

.btn-west,
.btn-west.pressed,
.btn-west:active {
    transform: translateY(-50%) !important;
}

.btn-east,
.btn-east.pressed,
.btn-east:active {
    transform: translateY(-50%) !important;
}

/* 特殊ボタン */
.special-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.btn-special {
    width: 60px;
    height: 30px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    pointer-events: auto;
    z-index: 120; /* 高いz-index */
}

.btn-special:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-special:active,
.btn-special.pressed {
    background: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 
        inset 0 3px 6px rgba(0, 0, 0, 0.6),
        0 0 10px rgba(255, 255, 255, 0.4) !important;
    transition: all 0.05s ease !important;
}

/* 下部のロゴエリア */
.bottom-bar {
    height: 60px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    font-size: 16px;
    font-weight: 300;
    font-family: 'Bebas Neue', 'Oswald', sans-serif;
    letter-spacing: 4px;
    color: transparent;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    background-clip: text;
    -webkit-background-clip: text;
    text-transform: uppercase;
    text-shadow: 
        0 0 20px rgba(102, 126, 234, 0.5),
        0 0 40px rgba(102, 126, 234, 0.3);
    animation: subtle-glow 3s ease-in-out infinite;
}

/* レスポンシブ対応はpc-styles.cssとsp-styles.cssに移行済み */
/* DeviceManagerによるデバイス判定でCSSを切り替えるため、メディアクエリは不要 */
