@charset "UTF-8";

/* フォント定義 */
@font-face {
    font-family: 'GameJapanese';
    src: url('../fonts/JF-Dot-jiskan24.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'GameEnglish';
    src: url('../fonts/PrStart.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'GameJapanese', Arial, sans-serif;
    background: #2c3e50;
    color: #ecf0f1;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: unset;
    font-smooth: never;
}

/* ワールド選択画面 */
#world-select {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

#world-select h1 {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #f1c40f;
    text-shadow: 2px 2px 0 #333;
    font-family: 'GameJapanese', Arial, sans-serif;
}

/* ワールド作成 */
.world-create {
    margin-bottom: 40px;
    background: #34495e;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #3498db;
}

#create-world-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'GameJapanese', Arial, sans-serif;
}

#create-world-btn:hover {
    background: #2ecc71;
}

#create-world-form {
    margin-top: 20px;
    text-align: left;
}

#create-world-form input,
#create-world-form textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    font-size: 1em;
    background: #ecf0f1;
    color: #2c3e50;
    font-family: 'GameJapanese', Arial, sans-serif;
}

#create-world-form label {
    display: block;
    margin: 15px 0;
    font-size: 1.1em;
    cursor: pointer;
}

#create-world-form button {
    margin: 10px 10px 0 0;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-family: 'GameJapanese', Arial, sans-serif;
}

#submit-world {
    background: #3498db;
    color: white;
}

#submit-world:hover {
    background: #2980b9;
}

#cancel-world {
    background: #e74c3c;
    color: white;
}

#cancel-world:hover {
    background: #c0392b;
}

/* ワールド一覧 */
.world-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.world-item {
    background: #34495e;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #3498db;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: left;
}

.world-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.world-item h3 {
    color: #f1c40f;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.world-item p {
    margin-bottom: 15px;
    line-height: 1.4;
}

.world-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #555;
    padding-top: 10px;
}

.world-meta small {
    color: #bdc3c7;
    font-size: 0.9em;
}

.edit-status {
    background: #27ae60;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
}

/* メイン画面（縦配置） */
#main-game {
    max-width: 800px;
    margin: 0 auto;
}

/* マップゾーン */
#map-zone {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

#game-canvas {
    border: 2px solid #fff;
    border-radius: 6px;
    background: #87CEEB;
    display: block;
    margin: 0 auto;
    cursor: crosshair;
}

/* 操作説明 */
#controls-container {
    background: #34495e;
    border-radius: 10px;
    border: 2px solid #3498db;
    padding: 20px;
    margin-bottom: 20px;
}

#controls-container h2 {
    color: #f1c40f;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
    font-family: 'GameJapanese', Arial, sans-serif;
}

#controls-content {
    text-align: center;
    color: #ecf0f1;
    font-size: 1.1em;
    font-family: 'GameJapanese', Arial, sans-serif;
}

/* FF風セリフ表示 */
#dialog-box {
    position: absolute;
    bottom: 7px;
    width: 630px;
    left: 50%;
    /* right: 10px; */
    margin-left: -315px;
    background: #0052CC;
    border: 2px solid white;
    border-radius: 4px;
    padding: 15px;
    font-family: 'GameJapanese', Arial, sans-serif;
    font-size: 1.2em;
    color: white;
    min-height: 80px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    text-align: left;
}

#dialog-text {
    line-height: 1.4;
}

/* エディットゾーン */
#edit-zone-container, #share-area {
    background: #34495e;
    border-radius: 10px;
    border: 2px solid #3498db;
    padding: 20px;
    margin-bottom: 20px;
}

#edit-zone-container h2, #share-area h2 {
    color: #f1c40f;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
    font-family: 'GameJapanese', Arial, sans-serif;
}

#no-edit-message {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1.1em;
}

/* アコーディオン */
.accordion-item {
    margin-bottom: 15px;
    border: 1px solid #3498db;
    border-radius: 5px;
    overflow: hidden;
}

.accordion-header {
    background: #3498db;
    color: white;
    padding: 15px;
    cursor: pointer;
    font-size: 1.1em;
    margin: 0;
    user-select: none;
    font-family: 'GameJapanese', Arial, sans-serif;
    transition: background 0.3s;
    position: relative;
}

.accordion-header::after {
    content: '+';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3em;
    line-height: 1;
}

.accordion-content.active + .accordion-header::after,
.accordion-header.active::after {
    content: '-';
}

.accordion-header:hover {
    background: #2980b9;
}

.accordion-content {
    padding: 20px;
    background: #2c3e50;
    display: none;
}

.accordion-content.active {
    display: block;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #ecf0f1;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'GameJapanese', Arial, sans-serif;
    background: #ecf0f1;
    color: #2c3e50;
}

.form-group input[type="radio"] {
    width: auto;
    margin-right: 8px;
}

.form-group input[type="file"] {
    border: none;
    background: #ecf0f1;
    padding: 8px;
}

/* 画像アップロードエリア */
.image-upload-area {
    background: #34495e;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #555;
    margin-bottom: 15px;
}

.separate-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.separate-images > div {
    text-align: center;
}

.separate-images label {
    font-size: 0.9em;
    margin-bottom: 5px;
}

/* 位置入力 */
.position-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.position-input input {
    width: 80px;
    flex-shrink: 0;
}

.position-input button {
    background: #f39c12;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    white-space: nowrap;
}

.position-input button:hover {
    background: #e67e22;
}

/* ボタンスタイル */
.save-btn, .add-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    font-family: 'GameJapanese', Arial, sans-serif;
    margin-top: 10px;
}

.save-btn {
    background: #27ae60;
    color: white;
}

.save-btn:hover {
    background: #2ecc71;
}

.add-btn {
    background: #3498db;
    color: white;
}

.add-btn:hover {
    background: #2980b9;
}

/* アイテムリスト */
.item-list {
    margin-top: 20px;
}

.mob-item, .event-item {
    background: #34495e;
    border: 1px solid #3498db;
    border-radius: 5px;
    padding: 15px;
    margin: 10px 0;
}

.mob-item h4, .event-item h4 {
    color: #f1c40f;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.mob-item p, .event-item p {
    color: #ecf0f1;
    margin: 5px 0;
    line-height: 1.3;
    font-size: 0.9em;
}

.delete-btn {
    background: #e74c3c !important;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 8px;
    width: auto !important;
}

.delete-btn:hover {
    background: #c0392b !important;
}

/* 共有エリア */
.share-description {
    margin-bottom: 15px;
    color: #bdc3c7;
    text-align: center;
}

.share-url-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-url-container input {
    flex: 1;
    padding: 10px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    background: #ecf0f1;
    color: #2c3e50;
    font-family: 'GameEnglish', monospace;
    font-size: 0.9em;
}

#copy-url {
    background: #f39c12;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'GameJapanese', Arial, sans-serif;
    white-space: nowrap;
}

#copy-url:hover {
    background: #e67e22;
}

/* 小さなテキスト */
small {
    display: block;
    color: #bdc3c7;
    font-size: 0.8em;
    margin-top: 5px;
    line-height: 1.3;
}

/* スマホ警告 */
#mobile-warning {
    background: #f0f0f0;
    color: #333;
    text-align: center;
    padding: 50px 20px;
    border-radius: 10px;
    margin: 50px auto;
    max-width: 600px;
    border: 2px solid #e74c3c;
    font-family: 'GameJapanese', Arial, sans-serif;
}

#mobile-warning h2 {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 2em;
}

/* レスポンシブ対応 */
@media screen and (max-width: 800px) {
    body {
        padding: 10px;
    }
    
    #main-game {
        padding: 0;
    }
    
    #game-canvas {
        width: 100%;
        height: auto;
        max-width: 640px;
    }
    
    #edit-zone-container, #share-area {
        padding: 15px;
    }
    
    .separate-images {
        grid-template-columns: 1fr;
    }
    
    .position-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .share-url-container {
        flex-direction: column;
    }
}

/* ユーティリティクラス */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ecf0f1;
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ゲーム内表示要素 */
.position-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-family: 'GameEnglish', monospace;
    font-size: 12px;
}

/* マップクリック時のヒント */
.map-click-hint {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.map-click-hint.show {
    opacity: 1;
}