/* ========================================
   寿司パニック - MRS GAMES
   HTML5 Canvas / モバイル対応（縦長）
======================================== */

:root {
    /* 広告バナーの高さ（実際の広告枠の高さに合わせて調整してください） */
    --ad-height: 60px;

    --color-bg: #e8dbcc;
    --color-loading-bg: #f4eee6;
    --color-loading-text: #d9381e;

    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    /* モバイルブラウザのアドレスバー等の出し引きに追従させる */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--color-bg);
    color: #1c3d5f;
    font-family: var(--font-body);
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

/* ========================================
   プレイエリア（広告枠を除いた領域）
   固定広告バナーとゲーム画面が重ならないよう、
   bottom を --ad-height ぶん確保する。
   上部はノッチ等のセーフエリアぶん確保する。
======================================== */

#play-area {
    position: fixed;
    top: env(safe-area-inset-top);
    left: 0;
    right: 0;
    bottom: calc(var(--ad-height) + env(safe-area-inset-bottom));

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--color-bg);
    width: 100%;
}

/* ========================================
   ゲームステージ（縦長480x854 / resizeCanvas() で
   実サイズを算出し width / height を設定する）
======================================== */

#game-stage {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 480px;
    max-height: 854px;
    background: #f4eee6;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---------------- 初期化中の表示 ---------------- */

#loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-loading-bg);
    color: var(--color-loading-text);
    font-size: 24px;
    font-weight: bold;
    z-index: 10;
}

/* ========================================
   固定広告
======================================== */

.ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    min-height: var(--ad-height);

    background-color: #121212;

    z-index: 1000;

    padding-top: 1px;
    padding-bottom: calc(1px + env(safe-area-inset-bottom));

    border-top: 1px solid #333;
}