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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    overflow: hidden;
}

#game-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 画面共通 */
#start-screen, #game-screen, #result-screen {
    text-align: center;
    width: 100%;
    max-width: 900px;
    padding: 20px;
    display: none; /* デフォルトは非表示 */
}


/* GameBaseの画面管理システムに対応 */
#start-screen.active, #game-screen.active, #result-screen.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* スタート画面 */
#start-screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#start-screen p {
    font-size: 20px;
    margin-bottom: 30px;
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin: 30px auto;
    max-width: 500px;
    text-align: left;
}

.instructions p {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.instructions ul {
    list-style: none;
    padding: 0;
}

.instructions li {
    padding: 8px 0;
    font-size: 16px;
}

.primary-btn {
    font-size: 24px;
    padding: 15px 40px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

.primary-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

/* ゲーム画面 */
#status-bar {
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

#game-canvas {
    background: #1a1a2e;
    border: 3px solid #667eea;
    border-radius: 10px;
    max-width: 100%;
    height: auto;
}

#input-area {
    margin-top: 15px;
}

#word-input {
    width: 100%;
    max-width: 500px;
    font-size: 24px;
    padding: 12px 20px;
    border: 3px solid #667eea;
    border-radius: 8px;
    text-align: center;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    transition: border-color 0.3s;
}

#word-input:focus {
    border-color: #4CAF50;
}

/* 結果画面 */
#result-screen h2 {
    font-size: 42px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.result-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
}

.result-stats p {
    font-size: 28px;
    margin-bottom: 15px;
}

.highlight {
    color: #FFD700;
    font-weight: bold;
    font-size: 36px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    #start-screen h1 {
        font-size: 32px;
    }

    #status-bar {
        font-size: 14px;
        flex-wrap: wrap;
        gap: 10px;
    }

    #game-canvas {
        width: 95vw !important;
        height: calc(95vw * 0.75) !important;
        max-width: 800px !important;
        max-height: 600px !important;
    }

    #word-input {
        font-size: 20px;
        padding: 15px 20px;
        max-width: 90%;
    }

    .result-stats p {
        font-size: 20px;
    }

    .highlight {
        font-size: 28px;
    }

    .instructions li {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #word-input {
        font-size: 18px;
        padding: 12px 15px;
    }
}
