/* ===== ベースレイアウト ===== */

html {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
}

/* ===== スプラッシュ画面 ===== */

@keyframes splashFadeIn {
    0% {
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    65% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    max-width: 480px;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#splash-text {
    font-size: 64px;
    color: #11213b;
    animation: splashFadeIn 2s ease-in-out;
    opacity: 0;
}

/* ===== タイトル画面 ===== */

.title-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 480px;
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    padding: 16px;
    background-color: #11213b;
}

.title-heading {
    color: #f5f5f5;
    font-size: 48px;
    margin-bottom: 40px;
}

.title-button {
    padding: 15px 30px;
    font-size: 24px;
    background-color: #04A643;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 15px;
}

.title-button:last-child {
    margin-bottom: 0;
}

/* ===== ゲーム画面 ===== */

.game-screen {
    display: none;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 0 24px;
}

#stage {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    /* 背景色はJavaScriptから設定（Config.stageBackgroundColor） */
}

/* 背景画像を擬似要素で表示（回転対応のため） */
#stage::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("/img/sushi_oke_empty.png");
    z-index: 1;
    pointer-events: none;
}

/* プレイヤー2用: 背景画像のみを180度回転 */
#stage.rotated-board::before {
    transform: rotate(180deg);
}

/* 駒や壁は背景画像より上に表示 */
#stage > * {
    position: relative;
    z-index: 2;
}

#status {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

.hidden {
    display: none;
}

#return-to-title-container {
    text-align: center;
    margin-top: 20px;
}

#return-to-title-btn {
    padding: 10px 20px;
    font-size: 18px;
    background-color: #e2a9c8;
    color: #11213b;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* ===== ネットワーク状態表示 ===== */

#network-status {
    width: auto;
    margin: 10px auto 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    box-sizing: border-box;
}

#room-id-display {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* ===== QRコード表示 ===== */

#qr-code-container {
    width: auto;
    margin: 15px auto;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    box-sizing: border-box;
}

#qr-code-title {
    font-size: 16px;
    font-weight: bold;
    color: #11213b;
    margin-bottom: 12px;
}

#qr-code {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

#qr-code canvas {
    border: 4px solid #11213b;
    border-radius: 4px;
}

#qr-code-url {
    font-size: 11px;
    color: #666;
    word-break: break-all;
    margin-bottom: 12px;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

#copy-url-btn {
    padding: 8px 20px;
    font-size: 14px;
    background-color: #04A643;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#copy-url-btn:hover {
    background-color: #038a35;
}

#copy-url-btn:active {
    background-color: #027a2d;
}

/* ===== あそびかたページ ===== */

.how-to-play-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #11213b;
    padding: 20px;
}

.how-to-play-content {
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    background-color: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.how-to-play-heading {
    color: #11213b;
    font-size: 32px;
    text-align: center;
    margin: 30px 0 20px;
    padding: 0 30px;
}

.how-to-play-body {
    flex: 1;
    padding: 0 30px 20px;
    overflow-y: auto;
    color: #11213b;
}

.how-to-play-body h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 20px;
    color: #11213b;
}

.how-to-play-body h4 {
    margin-top: 15px;
    margin-bottom: 8px;
    font-size: 18px;
    color: #11213b;
}

.how-to-play-body p {
    margin: 10px 0;
    line-height: 1.6;
}

.how-to-play-body ul {
    margin: 10px 0;
    padding-left: 25px;
}

.how-to-play-body li {
    margin: 8px 0;
    line-height: 1.6;
}

.how-to-play-body hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #ccc;
}

.how-to-play-body strong {
    color: #11213b;
    font-weight: bold;
}

.how-to-play-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #ddd;
    background-color: #f5f5f5;
}

.back-to-title-btn {
    padding: 12px 40px;
    font-size: 18px;
    background-color: #04A643;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.back-to-title-btn:hover {
    background-color: #038a35;
}


