body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    background-color: #eef2f5;
    color: #333333;
}

*:focus {
    outline: none !important;
}

.leaflet-interactive {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* 海の背景色を白にする */
.leaflet-container {
    background: #ffffff !important;
}

.main-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.map-section {
    flex: 1;
    position: relative;
    height: 100%;
}

#map-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

/* 右下の一覧ボタン */
#menu-btn {
    position: fixed;
    bottom: 85px;
    right: 25px;
    z-index: 3000;
    background: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: transform 0.3s ease, background 0.2s;
    padding: 0;
}

#menu-btn.warning::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background-color: #ffca28;
    border-radius: 50%;
    border: 2px solid white;
}

#menu-btn:hover { 
    background: #f8f9fa; 
    transform: scale(1.05);
}

#menu-btn.hidden-ui, .settings-btn.hidden-ui { display: none !important; }

/* 右上のカウント表示 */
#pref-counter {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: white;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: #444;
    transition: opacity 0.2s;
}

#pref-counter.hidden-ui { display: none; }

/* サイドパネルの基本設定 */
.list-section {
    width: 380px;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 500;
    transform: translateX(100%);
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    overflow: hidden;
}

.list-section.open { 
    transform: translateX(0); 
    box-shadow: -2px 0 15px rgba(0,0,0,0.1);
}

.panel-header {
    flex-shrink: 0;
    padding: 20px 25px 15px;
    position: relative;
    background: inherit;
    border-bottom: 1px solid #f0f0f0;
    z-index: 10;
}

.panel-header-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    position: relative;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px 25px 120px;
}

.panel-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.panel-close-btn:hover { color: #888; }

.status-dot {
    width: 10px;
    height: 10px;
    background-color: #ffca28;
    border-radius: 50%;
    display: inline-block;
    margin-left: 10px;
}

/* 警告バナー */
.warning-banner {
    background-color: #fff9c4;
    color: #f57f17;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 700;
}

/* モーダルスライダー */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.hidden { display: none; }

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2100;
}

#slide-image {
    max-width: 95%;
    max-height: calc(100vh - 160px);
    object-fit: contain;
    border-radius: 8px;
}

.slide-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.slide-controls button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
}

/* 一覧パネルのボタン */
.pref-btn {
    width: 100%;
    text-align: left;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    border: none;
    font-size: 1.1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

/* 写真グリッド */
.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.photo-grid-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.photo-grid-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.photo-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    cursor: pointer;
}

/* 設定ボタン（歯車） */
.settings-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 3000;
}

/* パネル右下の写真追加ボタン */
.add-photo-fab {
    position: absolute;
    bottom: 25px;
    right: 25px;
    width: 56px;
    height: 56px;
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
}

/* ローディング画面 */
#loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

#loading-overlay.hidden { display: none; }

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #eef2f5;
    border-top: 6px solid #6c8ca3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #444;
    font-weight: 700;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .list-section { width: 100%; }
}
/* =============================================
   ログイン / サインアップ 画面
   ============================================= */
.auth-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #eef2f5 0%, #dce6ee 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'Zen Kaku Gothic New', sans-serif;
}

.auth-screen.hidden { display: none; }

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px 35px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-title {
    margin: 0 0 2px 0;
    font-size: 2.2rem;
    color: #333;
    text-align: center;
    letter-spacing: 4px;
}

.auth-signup-link {
    text-align: center;
    font-size: 0.88rem;
    color: #aaa;
    margin: 0;
}

.auth-signup-link a {
    color: #6c8ca3;
    text-decoration: none;
    font-weight: bold;
}

.auth-signup-link a:hover {
    text-decoration: underline;
}

.auth-input {
    padding: 13px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #fafafa;
    color: #333;
    transition: border 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: #6c8ca3;
    background: white;
}

.auth-btn {
    padding: 14px;
    background: #6c8ca3;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    margin-top: 4px;
}

.auth-btn:hover { background: #5a7a91; }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-error {
    background: #fff0f0;
    color: #d32f2f;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    text-align: center;
}

.auth-success {
    background: #f0fff4;
    color: #2e7d32;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    text-align: center;
}

.auth-error.hidden, .auth-success.hidden { display: none; }

#app-screen.hidden { display: none; }
#app-screen { width: 100%; height: 100%; }