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

body {
    font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

h2 {
    color: #555;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: bold;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: #667eea;
}

.help-text {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.image-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary, .btn-success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #00d4ff 0%, #00a8cc 100%);
}

.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.game-link-container {
    margin-top: 30px;
    text-align: center;
}

.game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: #000;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
}

.game-screen {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.background-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.character-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 90px;
}

#character-image {
    max-height: 70%;
    max-width: 50%;
    object-fit: contain;
    transform: scale(1.5);
    transform-origin: bottom center;
    z-index: 1;
}

.text-box {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    min-height: 180px;
}

.dialogue-text {
    color: white;
    font-size: 18px;
    line-height: 1.8;
}

.choices-container {
    position: absolute;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.choice-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #667eea;
    padding: 15px 30px;
    font-size: 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 300px;
}

.choice-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.next-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid white;
    color: white;
    padding: 10px 20px;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.next-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.game-over h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 32px;
}

.game-over p {
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
}

#restart-btn {
    padding: 15px 40px;
}