/* 通向奥秘 - 全局样式 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap');

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

body {
    background: #0a0a0a;
    margin: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100vh;
    font-family: 'Noto Serif SC', serif;
    color: #ccc;
    touch-action: manipulation;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    user-select: none;
    -webkit-user-select: none;
    position: fixed;
    width: 100%;
    height: 100%;
}

#gameCanvas {
    border: none;
    display: block;
    width: 100vw;
    image-rendering: pixelated;
}

/* Start Screen */
#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: radial-gradient(ellipse at center, rgba(15,15,25,0.85) 0%, rgba(5,5,10,0.95) 100%);
    backdrop-filter: blur(4px);
}

#startScreen h1 {
    font-size: 3.5em;
    color: #d4c5a0;
    letter-spacing: 0.15em;
    margin-bottom: 0.3em;
    text-shadow: 0 0 20px rgba(212,197,160,0.3);
}

#startScreen .subtitle {
    font-size: 1.2em;
    color: #888;
    margin-bottom: 2em;
    letter-spacing: 0.1em;
}

#startScreen button {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1em;
    padding: 0.8em 2.5em;
    min-height: 48px;
    min-width: 48px;
    background: transparent;
    color: #d4c5a0;
    border: 1px solid #d4c5a0;
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    text-shadow: 0 0 6px rgba(212,197,160,0.2);
}

#startScreen button:hover {
    background: rgba(212,197,160,0.1);
    box-shadow: 0 0 20px rgba(212,197,160,0.2), inset 0 0 20px rgba(212,197,160,0.05);
}

#startScreen button:active {
    background: rgba(212,197,160,0.15);
}

/* UI Overlays (hidden by default) */
.dialogue-overlay,
.reflection-overlay,
.ending-overlay {
    display: none;
}

/* D-Pad */
#dpad {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#dpad.visible {
    display: flex;
}

.dpad-row {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.dpad-spacer {
    width: 56px;
    height: 56px;
}

.dpad-btn {
    width: 56px;
    height: 56px;
    background: rgba(212,197,160,0.15);
    border: 1px solid rgba(212,197,160,0.3);
    border-radius: 8px;
    color: #d4c5a0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.dpad-btn:active {
    background: rgba(212,197,160,0.35);
    border-color: rgba(212,197,160,0.6);
}

.dpad-action {
    font-size: 16px;
    font-weight: bold;
    background: rgba(212,197,160,0.1);
    border-color: rgba(212,197,160,0.2);
}

.dpad-action:active {
    background: rgba(212,197,160,0.4);
}

.dpad-action.hidden {
    visibility: hidden;
    pointer-events: none;
}

/* Hide D-Pad on desktop */
@media (hover: hover) and (pointer: fine) {
    #dpad {
        display: none !important;
    }
}
