/* ============================================================
   Pac-Man 经典街机 - 样式表
   ============================================================ */

/* ── 基础重置 ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #2A0A4F;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ── 游戏容器 ── */
#game-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
}

/* ── 游戏画布 ── */
#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    max-width: 100vw;
    max-height: 100vh;
    cursor: pointer;
}

/* ── 名字输入 Modal ── */
#name-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    font-family: 'Press Start 2P', 'Courier New', monospace;
}

#name-modal.visible { display: flex; }

#name-modal .box {
    background: #2A0A4F;
    border: 3px solid #FFD447;
    padding: 28px 32px;
    max-width: 90vw;
    min-width: 320px;
    color: #FFF;
    text-align: center;
    box-shadow: 0 0 32px rgba(255, 212, 71, 0.35);
}

#name-modal h2 {
    color: #FFFF00;
    font-size: 16px;
    margin-bottom: 8px;
}

#name-modal p {
    color: #FFB8AE;
    font-size: 9px;
    line-height: 1.6;
    margin-bottom: 18px;
}

#name-modal input {
    width: 100%;
    padding: 10px 12px;
    background: #1a0533;
    color: #FFF;
    border: 2px solid #FE5000;
    font-family: inherit;
    font-size: 12px;
    outline: none;
    margin-bottom: 14px;
    text-align: center;
}

#name-modal input:focus { border-color: #FFD447; }

#name-modal button {
    background: #FE5000;
    color: #FFF;
    border: none;
    padding: 10px 24px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    letter-spacing: 1px;
}

#name-modal button:hover { background: #FF6A1A; }

#name-modal .error {
    color: #FF6A6A;
    font-size: 8px;
    min-height: 12px;
    margin-bottom: 8px;
}

/* ── 玩家标识（右上角） ── */
#player-tag {
    position: fixed;
    top: 8px;
    right: 12px;
    color: #FFD447;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 10px;
    z-index: 50;
    pointer-events: auto;
    text-shadow: 1px 1px 0 #000;
}

#player-tag .change {
    color: #FFB8AE;
    cursor: pointer;
    margin-left: 8px;
    text-decoration: underline;
    font-size: 9px;
}

#player-tag .change:hover { color: #FE5000; }
