:root {
    --primary-color: #00d2ff;
    --secondary-color: #3a7bd5;
    --accent-color: #ffcc00;
    --bg-dark: #000;
    --glass-bg: #000;
    --glass-border: #fff;
    --text-main: #fff;
    --text-dim: #ccc;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', 'Shippori Mincho', sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    background: #000;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

/* オーバーレイ基本設定 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s ease;
}

.hidden {
    display: none !important;
    opacity: 0;
}

/* タイトル画面 */
#title-screen {
    background-image: url('assets/background.png');
    background-size: cover;
    background-position: center;
}

.background-dim {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, rgba(0,0,0,0.8) 100%);
}

#title-screen .content {
    position: relative;
    text-align: center;
    z-index: 101;
}

.glow-text {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 0.5rem;
    color: #fff;
    text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--secondary-color);
    margin-bottom: 0.5rem;
    animation: pulse 3s infinite alternate;
}

@keyframes pulse {
    from { text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--secondary-color); }
    to { text-shadow: 0 0 20px var(--primary-color), 0 0 40px var(--secondary-color), 0 0 10px white; }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.premium-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 1rem 3rem;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 210, 255, 0.6);
}

/* DQ風 UI */
.glass-panel {
    background: var(--glass-bg);
    border: 3px solid var(--glass-border);
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 0 0 2px #000; /* 内側の黒い縁取り */
}

/* ダイアログボックス */
#dialogue-box {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 150px;
    z-index: 200;
}

.name-tag {
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--primary-color);
    color: #000;
    padding: 2px 15px;
    font-weight: 700;
    border-radius: 4px;
    font-size: 0.9rem;
}

.message {
    font-size: 1.1rem;
    line-height: 1.6;
}

.continue-indicator {
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 0.8rem;
    color: var(--primary-color);
    animation: bounce 1s infinite;
}

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

/* HUD */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    width: 200px;
}

.label {
    font-weight: 700;
    font-size: 0.8rem;
    width: 30px;
}

.bar-bg {
    flex-grow: 1;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 100%;
    transition: width 0.3s ease;
}

.bar-fill.red { background: linear-gradient(to right, #ff416c, #ff4b2b); }
.bar-fill.blue { background: linear-gradient(to right, #2193b0, #6dd5ed); }

/* ローディング画面 */
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--glass-border);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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