/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    text-align: center;
    margin: 0;
    padding: 10px;
}

header h1 {
    color: #4a4a4a;
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* Main Menu Styles */
.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.game-link {
    background-color: #007bff;
    color: #fff;
    padding: 15px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.2s;
}

.game-link:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Game View Styles */
#game-container {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    width: 95%;
    max-width: 800px;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.game-header h3 {
    color: #007bff;
    font-size: 1.8em;
    margin: 0; /* h3 기본 마진 제거 */
}

.back-to-menu-btn {
    background-color: #6c757d;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.back-to-menu-btn:hover {
    background-color: #5a6268;
}

.game-view p {
    font-size: 1em;
    margin-bottom: 15px;
    color: #555;
}

.problem {
    font-size: 2em;
    font-weight: bold;
    color: #333;
    margin: 15px 0;
}

input, textarea {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    width: 85%;
    font-size: 1.1em;
    margin-bottom: 10px;
}

button {
    background-color: #28a745;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #218838;
}

.canvas-container, .pass-message {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

canvas {
    background-color: #e9f5ff;
    border: 2px solid #ddd;
    border-radius: 10px;
    max-width: 100%;
    height: auto;
}

.game-over-message, .pass-message {
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

.game-over-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 30px;
    font-size: 1.5em;
    width: 80%;
}

.game-over-message span {
    display: block;
    font-size: 0.6em;
    margin-top: 10px;
    font-weight: normal;
}

.pass-message {
    background-color: #fff;
    border: 2px solid #28a745;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.pass-message h2 {
    color: #28a745;
    font-size: 2em;
    margin-bottom: 10px;
}

/* 1984 Shooting Game Specific Styles */
#shooting-1984-canvas {
    background-color: #000;
}

/* --- Media Queries --- */
@media (max-width: 768px) {
    body { padding: 5px; }
    header h1 { font-size: 1.8em; }
    .game-list { grid-template-columns: 1fr; }
    .game-header h3 { font-size: 1.5em; }
    .problem { font-size: 1.8em; }
    input, textarea { width: 90%; }
}

@media (max-width: 480px) {
    header h1 { font-size: 1.5em; margin-bottom: 15px; }
    #game-container { padding: 15px; }
    .game-over-message, .pass-message { font-size: 1.2em; padding: 10px 20px; }
    .pass-message h2 { font-size: 1.8em; }
}
