﻿:root {
    /* Hybrid Theme: Pokedex x Research Guide */
    --primary-cyan: #4dd0e1;
    --secondary-cyan: #00acc1;
    --accent-orange: #ffa726;
    --paper-background: #fffdf9;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-dark: #2c3e50;
    --text-medium: #546e7a;
    --border-game: 2px solid #b2ebf2;
    --shadow-game: 0 4px 0 rgba(0, 0, 0, 0.1);
}

body {
    /* デフォルト背景色 */
    background-color: #f5f5f5;
    /* 背景画像はJavaScriptで動的に設定 */
    background-image: url('assets/bg_gazou1.jpg?v=20260207a');
    background-size: 100% auto;
    background-position: top center;
    background-attachment: scroll;
    background-repeat: repeat;
    color: var(--text-dark);
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* 背景画像がロードされる前のフォールバック用。画像そのままを表示するためオーバーレイは削除 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    z-index: -1;
}

/* --- New Navigation Styles (Icon Only) --- */
.icon-only-nav {
    padding: 0;
    justify-content: center;
}

.icon-only-nav .scroll-container {
    width: 100%;
    max-width: 600px;
    /* Keep nav compact */
    justify-content: space-around;
}

.icon-only-nav .nav-tab {
    padding: 12px 10px;
    height: 50px;
    justify-content: center;
    border-right: none;
    /* SQL-like cleaner look */
}

.icon-only-nav .nav-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.icon-only-nav .nav-tab span:not(.nav-icon) {
    display: none;
    /* Hide text labels */
}

/* --- View Architecture --- */
.content-view {
    animation: fadeIn 0.4s ease;
    width: 100%;
}

.view-title {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 4px solid var(--primary-green);
}

/* --- Stats Box (New) --- */
/* --- Stats Box (New) & Profile Layout --- */
.zukan-header-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* 中央揃えに変更 */
    align-items: center;
    /* Vertically align center */
    gap: 20px;
    /* Fixed gap between profile and stats */
    margin-bottom: 20px;
    padding: 0 10px;
}

.zukan-profile-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center vertically */
    flex: 0 0 auto;
}

.profile-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 6px;
    background-color: #eee;
}

.profile-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zukan-stats-container {
    display: flex;
    justify-content: center;
    /* 中央揃えに変更 */
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    /* Allow wrapping */
    flex: 0 1 auto;
    /* Don't force expand */
}

.stat-box {
    background: white;
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--shadow-sm);

    /* Compact Rectangular Box */
    flex: 0 0 120px;
    width: 120px;
    max-width: 120px;
    height: 100px;
    box-sizing: border-box;
    /* Includes padding in width */

    text-align: center;
    border: 1px solid #eee;
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Color Modifiers for Stats */
.stat-box.score-box {
    background: linear-gradient(135deg, #e53935, #b71c1c);
    /* Deep Red */
    color: white;
    border: none;
}

.stat-box.count-box {
    background: linear-gradient(135deg, #43a047, #1b5e20);
    /* Deep Forest Green */
    color: white;
    border: none;
}

.stat-box.score-box .stat-label,
.stat-box.score-box .stat-value,
.stat-box.score-box .stat-unit,
.stat-box.count-box .stat-label,
.stat-box.count-box .stat-value,
.stat-box.count-box .stat-unit {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Clickable stat boxes */
.stat-box.clickable-stat {
    cursor: pointer;
    transition: all 0.3s ease;
}

.stat-box.clickable-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-box.clickable-stat.active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 8px 20px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-medium);
    margin-bottom: 2px;
    font-weight: 700;
    white-space: nowrap;
    /* Prevent text wrapping */
    width: 100%;
}

.stat-value {
    color: var(--primary-green);
    line-height: 1.2;
    font-family: 'Roboto', sans-serif;
    padding-bottom: 8px;
}

.stat-num {
    font-size: 2.2rem;
    /* Reduced for compact box */
    font-weight: 900;
    letter-spacing: -1px;
}

.stat-unit {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 0.7rem;
    color: var(--text-medium);
    font-weight: 700;
}

/* --- Top 5 Difficult Birds Section --- */
.zukan-top5-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 0;
}

.top5-header {
    font-size: 0.8rem;
    color: var(--text-medium);
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
}

.top5-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.top5-card {
    position: relative;
    width: 60px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    background: #f0f0f0;
    transition: transform 0.2s;
}

.top5-card:hover {
    transform: translateY(-2px);
}

.top5-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top5-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-bottom-right-radius: 4px;
    font-weight: bold;
}

.top5-rank {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--primary-green);
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 4px;
    font-weight: bold;
}

/* --- Widget View (Zukan) --- */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}

.widget-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: var(--shadow-game);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.widget-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-cyan);
    box-shadow: 0 8px 15px rgba(77, 208, 225, 0.3), 0 4px 0 var(--secondary-cyan);
    z-index: 2;
}

/* Observed bird highlight removed per user request
.bird-card.observed {
    border-color: var(--primary-cyan);
    background: linear-gradient(135deg, #e0f7fa 0%, #ffffff 100%);
}
*/


.bird-card-inner {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.bird-image-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bird-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.widget-card:hover .bird-thumbnail {
    transform: scale(1.1);
}

.bird-info-box {
    padding: 4px 2px;
    width: 100%;
    text-align: center;
    background: white;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bird-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.bird-number {
    font-size: 0.7rem;
    color: var(--text-medium);
    font-family: 'Roboto Mono', monospace;
}

.bird-placeholder {
    font-size: 2.5rem;
    opacity: 0.5;
}

.widget-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.widget-card:hover .widget-bg-image {
    transform: scale(1.1);
}

.widget-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
}

.widget-name {
    color: white;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    /* Gothic/Bold */
    font-size: 1.1rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 4px;
}

.widget-sub {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Placeholder Views --- */
.placeholder-view {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.action-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    background: var(--primary-green);
    color: white;
    text-decoration: none;
    border-radius: 24px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
    transition: all 0.2s ease;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.4);
}

/* Settings Styles */
.settings-container {
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.settings-group {
    margin-bottom: 30px;
}

.settings-group h4 {
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

/* Auth button adjustments for settings */
#auth-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .widget-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 cols on mobile */
        gap: 12px;
    }

    .widget-name {
        font-size: 0.95rem;
    }
}

/* --- Floating Action Button (FAB) --- */
.fab-button {
    position: fixed;
    bottom: 80px;
    /* Above bottom safe area */
    right: 24px;
    width: 64px;
    height: 64px;
    background: var(--primary-green);
    border-radius: 50%;
    color: white;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    z-index: 1000;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-button:hover {
    transform: scale(1.1);
}

/* --- Bird Selector UI --- */

/* Tab-based Search UI Styles */
.bird-search-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-medium);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-tab:hover {
    background: rgba(46, 125, 50, 0.05);
    color: var(--primary-green);
}

.search-tab.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
    background: rgba(46, 125, 50, 0.05);
}

/* Search Content Containers */
.search-content {
    display: none !important;
}

.search-content.active {
    display: block !important;
}

.bird-selector-container {
    margin-bottom: 20px;
}

.kana-selector-grid {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.order-filter-container.search-content {
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 15px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.order-filter-container.search-content.active {
    display: grid !important;
}

/* Difficulty Grid in Modal */
.difficulty-selector-grid.search-content {
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 15px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    display: none;
}

.difficulty-selector-grid.search-content.active {
    display: grid !important;
}

.kana-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.kana-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    color: var(--text-dark);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.kana-btn:hover {
    background: #e8f5e9;
    border-color: var(--primary-green);
}

.kana-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
    transform: scale(1.1);
}

.kana-placeholder {
    width: 32px;
    height: 32px;
}

/* Filtered Bird List */
.filtered-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.filtered-list.hidden {
    display: none;
}

.bird-select-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.bird-select-card:hover {
    border-color: #c8e6c9;
}

.bird-select-card.selected {
    border-color: var(--primary-green);
    background: #f1f8e9;
}

.select-bird-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 6px;
}

.select-bird-name {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.select-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #eee;
    color: #999;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bird-select-card.selected .select-check {
    background: var(--primary-green);
    color: white;
}

/* Selected Preview Chips */
.selected-birds-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 40px;
}

.bird-chip {
    background: #e8f5e9;
    color: var(--primary-green);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip-remove {
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.6;
}

.chip-remove:hover {
    opacity: 1;
}

/* --- Zukan Stats Card --- */
.zukan-stats-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto 30px auto;
    padding: 24px 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Ensure inner elements don't have excessive margins */
.zukan-stats-card .zukan-header-area {
    margin-bottom: 0;
    width: 100%;
}

.zukan-stats-card .bg-test-container {
    margin: 0;
    padding: 10px 0 0 0;
    border-top: 1px solid #f0f0f0;
    width: 100%;
}

.empty-selection-msg {
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
    padding: 8px 0;
}

/* --- Form Components --- */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.form-half {
    flex: 1;
}

.weather-selector,
.biome-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}

.biome-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    width: 60px;
    /* Ensure uniform width for labels */
}

.biome-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.biome-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-medium);
    text-align: center;
    white-space: nowrap;
}

.biome-item:hover .biome-swatch {
    transform: scale(1.15);
}

.biome-item.active .biome-swatch {
    border-color: #333;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #4caf50;
    transform: scale(1.1);
}

.biome-item.active .biome-label {
    color: var(--primary-green);
}

.weather-item {
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.weather-item:hover {
    background: #eeeeee;
}

.weather-item.active {
    background: #e8f5e9;
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Image Upload Styles */
.upload-btn {
    background-color: #f5f5f5;
    border: 2px dashed #ccc;
    color: var(--text-medium);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: all 0.2s;
    text-align: center;
}

.upload-btn:hover {
    background-color: #e8f5e9;
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.preview-thumb-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-thumb-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Timeline Image Styles */
.note-images-gallery {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.note-gallery-img {
    height: 120px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    flex-shrink: 0;
}

/* --- Observation Modal --- */
#observation-modal.modal-overlay {
    position: fixed !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Sheet style on mobile */
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.observation-modal-content {
    background: white;
    width: 100%;
    max-width: 600px;
    height: 90vh;
    /* Almost full screen */
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal-overlay.active .observation-modal-content {
    transform: translateY(0);
}

@media (min-width: 600px) {
    .observation-modal-content {
        height: auto;
        max-height: 90vh;
        border-radius: 20px;
        align-self: center;
        /* Center on desktop */
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-dark);
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* --- Field Note Timeline Styles --- */
.field-note-entry {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin: 0 auto 24px auto;
    /* 左右中央寄せ、下に24pxのマージン */
    max-width: 600px;
    /* タブの最大幅(600px)に合わせる */
    width: 100%;
    /* スマホなどでタブと同じ幅いっぱいまで広げる */
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.4s ease;
}

.note-header {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(2px);
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.note-edit-btn {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.note-edit-btn:hover {
    background: #f0f0f0;
    border-color: var(--primary-green);
    transform: scale(1.05);
}

/* Note Stats Inline */
.note-stats-inline {
    display: flex;
    gap: 8px;
    margin-left: auto;
    margin-right: 12px;
}

.note-stat-box {
    min-width: 60px;
    padding: 6px 10px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.note-stat-score {
    background: linear-gradient(135deg, #e53935, #b71c1c);
    color: white;
}

.note-stat-count {
    background: linear-gradient(135deg, #43a047, #1b5e20);
    color: white;
}

.note-stat-value {
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 2px;
}

.note-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.9;
}

.note-title-text {
    font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.note-loc-text {
    font-size: 1.25rem;
    margin-right: 4px;
}

.note-pref-text {
    font-size: 1.1rem;
    margin-right: 12px;
}

.note-datetime-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.note-sub-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.note-weather-span {
    display: flex;
    gap: 6px;
    font-size: 1.1rem;
}

/* Responsive wrap */
@media (max-width: 480px) {
    .note-datetime-text {
        display: block;
        margin-left: 0;
        margin-top: 4px;
        font-size: 0.95rem;
    }
}

.note-header {
    background: #f9f9f9;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.note-date {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.note-location {
    font-size: 0.9rem;
    color: var(--text-medium);
    background: white;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 4px;
}

.note-content {
    background: transparent;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.note-memo {
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.5;
    white-space: pre-wrap;
    /* Preserve line breaks */
}

.note-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #999;
    margin-bottom: 4px;
    display: block;
}

.note-birds-container {
    padding: 20px;
}

.note-birds-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    /* 野鳥同士の隙間にマージンを追加 */
}

/* Zukan Selectors */
.difficulty-selector-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.difficulty-btn {
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.difficulty-btn img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.difficulty-btn:hover img,
.difficulty-btn.active img {
    transform: scale(1.05);
}

.difficulty-btn.active {
    border-color: var(--secondary-cyan);
    background: #e0f7fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 172, 193, 0.2);
}

.order-selector-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.order-selector-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 4px;
    background: white;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.order-selector-btn.active {
    border-color: var(--primary-green);
    background: var(--bg-light-green);
}

.order-selector-btn img {
    width: 28px;
    height: 28px;
}

.order-selector-btn span {
    font-size: 0.65rem;
    text-align: center;
    color: var(--text-dark);
}

.kana-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

.kana-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.bird-card {
    background: #fff;
    border-radius: 2px;
    padding: 8px 8px 12px 8px;
    /* Polaroid proportion */
    border: 1px solid #ddd;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: transform 0.2s ease;
    cursor: pointer;
    overflow: visible;
}

.bird-card:hover {
    transform: rotate(1deg) scale(1.02);
    z-index: 5;
}

/* Mobile Adjustments */
@media screen and (max-width: 480px) {

    .difficulty-selector-grid,
    .order-selector-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 8px !important;
        padding: 8px !important;
    }

    .difficulty-btn,
    .order-selector-btn {
        padding: 4px 2px !important;
        border-radius: 6px !important;
    }

    .order-selector-btn img {
        width: 22px !important;
        height: 22px !important;
    }

    .order-selector-btn span {
        font-size: 0.55rem !important;
        line-height: 1.1;
    }

    .kana-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .difficulty-btn span {
        font-size: 8px !important;
    }
}

/* Unsorted Section */
.unsorted-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px dashed #eee;
}

.unsorted-header {
    text-align: center;
    color: var(--text-medium);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-medium);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #f9f9f9;
}

.form-input:focus {
    border-color: var(--primary-green);
    background: white;
    outline: none;
}

textarea.form-input {
    resize: vertical;
}

.bird-selection-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.secondary-button {
    width: 100%;
    padding: 14px;
    background: #e8f5e9;
    color: var(--primary-green);
    border: 2px dashed var(--primary-green);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    border-style: dashed;
    /* Explicitly set border style */
}

/* Modal Footer */
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    background: white;
}

.cancel-button {
    flex: 1;
    padding: 12px;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
}

.delete-button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #e53935, #b71c1c);
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
    transition: all 0.2s;
}

.delete-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(229, 57, 53, 0.4);
}

.save-button {
    flex: 2;
    padding: 12px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

/* --- Zukan View Mode Controls --- */
.zukan-view-controls {
    display: flex;
    gap: 12px;
    margin: 20px 20px;
    padding: 0;
}

.view-mode-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.observation-btn {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.observation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}


.view-mode-btn.active {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.btn-icon {
    font-size: 1.2em;
}

.btn-text {
    font-weight: 700;
}

/* First Sighting (New Species) Highlight */
.widget-card.first-sighting {
    box-shadow: 0 0 0 3px #ffd700, 0 8px 16px rgba(255, 215, 0, 0.4);
    border: none;
    background: linear-gradient(135deg, #fff080, #ffd700, #ffb300, #ffea00);
    z-index: 5;
    transform: translateY(-2px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-card.first-sighting .widget-bg-image {
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    border-radius: 17px;
    /* Slightly inner radius */
    object-fit: cover;
}

/* NEW badge for first sightings */
.widget-card.first-sighting::before {
    content: "✨ 初記録";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 10px;
    border-radius: 20px;
    border: 2px solid #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    white-space: nowrap;
}

.widget-card.first-sighting::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 6;
}

/* Map Button Styles */
.note-location-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.note-map-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    text-decoration: none;
    font-size: 1.1rem;
    margin-left: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.note-map-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* --- Custom Date Picker --- */
.custom-date-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f9f9f9;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #ddd;
    user-select: none;
}

.date-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
}

.date-arrow {
    background: none;
    border: none;
    color: var(--primary-green);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 24px;
    border-radius: 4px;
    transition: background 0.2s;
    touch-action: manipulation;
}

.date-arrow:hover {
    background: rgba(46, 125, 50, 0.1);
}

.date-arrow:active {
    background: rgba(46, 125, 50, 0.2);
}

.date-value {
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    min-width: 44px;
    text-align: center;
    padding: 2px 0;
    font-variant-numeric: tabular-nums;
}

.date-separator {
    font-weight: 700;
    color: #ccc;
    font-size: 1.2rem;
    padding-bottom: 2px;
}

/* Time Picker Styles (Shared with Date Picker mostly) */
.custom-time-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #f9f9f9;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid #ddd;
    user-select: none;
    width: 100%;
}

.time-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    flex: 1;
}

.time-separator {
    font-weight: 700;
    color: #ccc;
    font-size: 1.2rem;
    padding-bottom: 2px;
}

/* --- Responsive Date/Time Layout --- */
.date-time-row {
    flex-wrap: wrap;
    /* Allow wrapping for responsive behavior */
}

/* Specific group sizing */
.date-group {
    flex: 2 1 200px;
    /* Grow 2, Shrink to 200px basis */
}

.time-group {
    flex: 1 1 140px;
    /* Increase basis to ensure content fits without wrapping */
}

/* Force wrap on mobile */
@media (max-width: 600px) {
    .date-time-row {
        gap: 10px;
    }

    .date-group {
        flex: 1 1 100%;
        /* Date takes full width on mobile */
        order: 1;
    }

    .time-group {
        /* On mobile, if screen is very small, this allows stacking */
        /* If screen is wide enough (e.g. >350px), they might sit side-by-side */
        flex: 1 1 140px;
        order: 2;
    }
}

/* Additional safety for time picker internals */
.custom-time-picker {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    /* Never wrap internal time columns */
    white-space: nowrap !important;
    /* Absolutely no text wrapping */
}

/* --- Location Row Layout --- */
.location-row {
    align-items: flex-start;
    flex-wrap: wrap;
    /* Ensure valid wrap on mobile */
}

.pref-group {
    flex: 1 1 140px;
    /* Min width for prefecture dropdown */
}

.place-group {
    flex: 2 1 200px;
    /* Takes more space, wraps if needed */
}

/* Force wrap on very small screens for location row too */
@media (max-width: 480px) {
    .location-row {
        gap: 12px;
    }

    .pref-group,
    .place-group {
        flex: 1 1 100%;
    }
}

/* --- Weather Icon Images --- */
.weather-item {
    width: 48px;
    /* Slightly larger for touch targets */
    height: 48px;
    padding: 6px;
    background: #f9f9f9;
    /* Reset font size since we use images now, though it won't hurt */
}

.weather-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    /* Let clicks pass to button */
}

.weather-item.active {
    background: #e8f5e9;
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.time-column {
    min-width: 32px;
    /* Ensure columns don't collapse too much */
}

/* --- Game UI Settings (Nintendo-style Polish) --- */
.game-settings-container {
    max-width: 900px;
    /* 少し広げる */
    margin: 0 auto;
    padding: 30px 15px;
    background-color: #f8fafc;
    background-image:
        radial-gradient(#e2e8f0 1px, transparent 1px),
        linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
    background-size: 20px 20px, 100% 100%;
    background-attachment: fixed;
    min-height: 100vh;
    animation: fadeIn 0.5s ease;
}

/* カードを並べる親要素 - 縦並びレイアウト */
.game-settings-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    justify-content: flex-start;
    max-width: 600px;
    margin: 0 auto;
}

.game-collection-summary,
.game-profile-card {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 32px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.game-collection-summary {
    align-items: center;
}

/* 円グラフ外の分数表示（下部） */
.gauge-fraction {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: -15px;
    text-align: center;
}

.gauge-percent {
    font-size: 18px;
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 円グラフのSVGラッパー */
.collection-gauge-wrapper-mini {
    position: relative;
    width: 100px;
    height: 100px;
}

.collection-gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
    width: 100%;
    height: 100%;
}

.stats-toggle-container {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 50px;
    margin-bottom: 25px;
    width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.stats-toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-toggle-btn.active {
    background: white;
    color: #334155;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.collection-gauges-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    width: 100%;
    margin-bottom: 25px;
    gap: 10px;
}

.gauge-item-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    gap: 10px;
    flex: 1;
}

/* レベル別達成状況（コップ型ゲージ） */
.game-level-progress-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.level-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 15px;
    max-width: 600px;
    /* 横に広がりすぎないよう制限 */
}

/* コップ型アイテム */
.level-cup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: white;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    position: relative;
}

.level-cup-item:hover {
    transform: translateY(-4px);
    border-color: #e2e8f0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* バッジ画像 */
.cup-badge-container {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.cup-badge-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* コップ本体 */
.cup-container {
    position: relative;
    width: 60px;
    height: 120px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(240, 240, 240, 0.3));
    border: 2px solid #cbd5e1;
    border-radius: 8px 8px 12px 12px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* 液体の塗り（下から溜まる） */
.cup-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, currentColor, rgba(255, 255, 255, 0.3));
    border-radius: 0 0 10px 10px;
    transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ガラスのハイライト */
.cup-glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 50%, rgba(255, 255, 255, 0.2) 100%);
    pointer-events: none;
}

/* ゲージ内の統計表示（コップ型用） */
.cup-inner-stats {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.cup-inner-percent {
    font-size: 18px;
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
}

/* ゲージ外の分数表示（コップ型用） */
.cup-fraction {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 2px;
    text-align: center;
}

/* 全種アイテム（横長表示） */
.level-cup-item.total-item {
    grid-column: 1 / -1;
    flex-direction: row;
    padding: 16px 24px;
    background: linear-gradient(135deg, #fef3c7, #fef08a);
    border: 2px solid #fbbf24;
    gap: 20px;
}

.level-cup-item.total-item .cup-badge-container {
    margin-bottom: 0;
}

.level-cup-item.total-item .cup-container {
    margin-bottom: 0;
}

.level-cup-item.total-item .cup-label {
    font-size: 1.1rem;
    margin-bottom: 0;
    min-width: 60px;
}

.level-cup-item.total-item .cup-stats {
    flex-direction: row;
    gap: 12px;
}


.collection-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    margin-top: 10px;
}

.game-stat-card {
    background: white;
    border-radius: 20px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
}

.game-stat-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: #334155;
    display: block;
}

.game-stat-lbl {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 700;
}

/* --- Level Progress Section Styles --- */
.game-level-progress-section {
    width: 100%;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed #e2e8f0;
}

.game-level-progress-section .section-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 0.5px;
}

.level-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    width: 100%;
}

.level-stat-item {
    background: white;
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    border: 1px solid #f1f5f9;
}

/* Full width for total (last item) */
.level-stat-item.total-item {
    grid-column: span 3;
    margin-top: 4px;
    background: linear-gradient(to right, #ffffff, #f0f9ff);
    flex-direction: row;
    justify-content: space-around;
    padding: 12px;
}

.level-gauge-mini {
    position: relative;
    width: 44px;
    height: 44px;
    margin-bottom: 6px;
}

.level-stat-item.total-item .level-gauge-mini {
    margin-bottom: 0;
    width: 50px;
    height: 50px;
}

.level-gauge-mini svg {
    transform: rotate(-90deg);
}

.level-percent-mini {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.65rem;
    font-weight: 800;
    color: #334155;
    font-family: 'Roboto', sans-serif;
}

.level-label-mini {
    font-size: 0.65rem;
    font-weight: 700;
    color: #94a3b8;
}

.level-count-mini {
    font-size: 0.55rem;
    color: #cbd5e1;
    margin-top: 2px;
}

/* --- Profile Avatar & Name Edit Icons --- */
.game-edit-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    z-index: 5;
}

.game-edit-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    border-color: #4facfe;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* 反転用クラス (Emoji ✎ を反転) */
.game-edit-btn {
    transform: scaleX(-1);
}

.game-edit-btn:hover {
    transform: scaleX(-1) scale(1.1) rotate(10deg);
}

.game-edit-btn.avatar-edit {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #4facfe;
    color: white;
    border: 2px solid white;
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.game-user-name-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.game-edit-btn.name-edit {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    background: #f1f5f9;
    color: #475569;
}

.game-user-name {
    margin-bottom: 0 !important;
    display: inline-block;
}

/* ログアウトボタン（ミニ・上部右端） */
.logout-btn-mini {
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 6px 0;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    align-self: center;
    margin-left: auto;
}

.logout-btn-mini:hover {
    color: #ef4444;
    text-decoration: underline;
}

/* 大型バッジ表示エリア (下部) */
.game-badge-area-large {
    display: flex;
    justify-content: space-around;
    padding: 20px 0 10px 0;
    border-top: 1px dashed #e2e8f0;
    margin-top: 5px;
}

.badge-slot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.game-badge-slot-large {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #f8fafc;
    border: 3px dashed #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 2.8rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.game-badge-slot-large:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: scale(1.05);
}

.game-badge-slot-large.filled {
    border: 3px solid #e0f2fe;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.badge-slot-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: #475569;
    text-align: center;
}

.badge-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.4;
    filter: grayscale(1);
}

.bg-test-btn.locked {
    filter: brightness(0.85);
    /* 画像を見せるために明るさを少し落とす程度にする */
    cursor: not-allowed;
    opacity: 0.95;
}

.badge-item.earned {
    opacity: 1;
    filter: none;
}

.badge-item.earned:hover {
    background: #f0fdf4;
    transform: translateY(-2px);
}

.badge-item.selected {
    background: #e0f2fe;
    border: 2px solid #0ea5e9;
}

.badge-icon-large {
    font-size: 2.5rem;
}

.badge-name {
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    color: #475569;
}

.badge-req {
    font-size: 0.6rem;
    color: #94a3b8;
    text-align: center;
}

.game-profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 5px;
    padding-bottom: 10px;
}

.game-avatar {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: #f1f5f9;
    border: 4px solid #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    /* アイコン用 */
}

.game-user-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}

.game-user-rank {
    display: inline-block;
    background: #ecfdf5;
    color: #059669;
    padding: 3px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid #d1fae5;
}

.game-button-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: auto;
    /* 下寄せ */
}

/* ゲーム風ボタン ( Pill Button - Switch Style ) */
.game-pill-btn {
    background: #ffffff;
    border: none;
    padding: 18px 24px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.05rem;
    color: #475569;
    box-shadow: 0 6px 0 #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.1s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
    text-align: left;
}

.game-pill-btn:hover {
    background: #f8fafc;
}

.game-pill-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #cbd5e1;
}

.game-pill-btn.primary {
    background: #0ea5e9;
    color: white;
    box-shadow: 0 6px 0 #0284c7;
    border: none;
}

.game-pill-btn.primary:hover {
    background: #0284c7;
}

.game-pill-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    box-shadow: 0 6px 0 #cbd5e1;
}

.game-pill-btn.logout {
    margin-top: 10px;
    background: transparent;
    box-shadow: none;
    color: #94a3b8;
    justify-content: center;
    font-size: 0.9rem;
    border: none;
}

.game-pill-btn.logout:hover {
    color: #ef4444;
    text-decoration: underline;
}

/* ログイン画面 */
.game-login-view {
    max-width: 500px;
    margin: 40px auto;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

.game-title-logo {
    font-size: 2.8rem;
    font-weight: 900;
    color: #059669;
    margin-bottom: 12px;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.05);
}

.google-game-btn {
    background: white;
    padding: 20px 40px;
    border-radius: 24px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 8px 0 #cbd5e1;
    font-weight: 800;
    font-size: 1.2rem;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.google-game-btn:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #cbd5e1;
}

/* ======================================== Difficulty Top5 Section ======================================== */
.difficulty-top5-section {
    margin-top: 24px;
}

.section-divider {
    border-top: 2px dashed #e2e8f0;
    margin-bottom: 16px;
}

.difficulty-top5-header {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 12px;
    text-align: center;
}

.difficulty-top5-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.top5-bird-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top5-bird-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.top5-bird-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top5-difficulty-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.top5-check-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.top5-bird-name {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-align: center;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Responsive Layout Fixes === */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.game-settings-layout {
    width: 100%;
    max-width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
}

.game-profile-card,
.game-collection-summary {
    max-width: calc(100vw - 20px);
    box-sizing: border-box;
    padding: 15px 10px;
}

.level-stats-grid {
    max-width: 100% !important;
    box-sizing: border-box;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.level-cup-item {
    padding: 8px 2px;
    border-radius: 8px;
}

.cup-badge-container {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
}

.cup-container {
    width: 40px;
    height: 80px;
    border-radius: 4px 4px 6px 6px;
    margin-bottom: 6px;
}

.cup-inner-percent {
    font-size: 0.7rem;
}

.cup-fraction {
    font-size: 0.6rem;
}

.game-profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 5px;
    padding-bottom: 10px;
}

.game-avatar {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: #f1f5f9;
    border: 4px solid #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    /* アイコン用 */
}

.game-user-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}

.game-user-rank {
    display: inline-block;
    background: #ecfdf5;
    color: #059669;
    padding: 3px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid #d1fae5;
}

.game-button-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: auto;
    /* 下寄せ */
}

/* ゲーム風ボタン ( Pill Button - Switch Style ) */
.game-pill-btn {
    background: #ffffff;
    border: none;
    padding: 18px 24px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.05rem;
    color: #475569;
    box-shadow: 0 6px 0 #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.1s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
    text-align: left;
}

.game-pill-btn:hover {
    background: #f8fafc;
}

.game-pill-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #cbd5e1;
}

.game-pill-btn.primary {
    background: #0ea5e9;
    color: white;
    box-shadow: 0 6px 0 #0284c7;
    border: none;
}

.game-pill-btn.primary:hover {
    background: #0284c7;
}

.game-pill-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    box-shadow: 0 6px 0 #cbd5e1;
}

.game-pill-btn.logout {
    margin-top: 10px;
    background: transparent;
    box-shadow: none;
    color: #94a3b8;
    justify-content: center;
    font-size: 0.9rem;
    border: none;
}

.game-pill-btn.logout:hover {
    color: #ef4444;
    text-decoration: underline;
}

/* ログイン画面 */
.game-login-view {
    max-width: 500px;
    margin: 40px auto;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

.game-title-logo {
    font-size: 2.8rem;
    font-weight: 900;
    color: #059669;
    margin-bottom: 12px;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.05);
}

.google-game-btn {
    background: white;
    padding: 20px 40px;
    border-radius: 24px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 8px 0 #cbd5e1;
    font-weight: 800;
    font-size: 1.2rem;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.google-game-btn:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #cbd5e1;
}

/* ======================================== Difficulty Top5 Section ======================================== */
.difficulty-top5-section {
    margin-top: 24px;
}

.section-divider {
    border-top: 2px dashed #e2e8f0;
    margin-bottom: 16px;
}

.difficulty-top5-header {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 12px;
    text-align: center;
}

.difficulty-top5-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.top5-bird-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top5-bird-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.top5-bird-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top5-difficulty-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.top5-check-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.top5-bird-name {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-align: center;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Responsive Layout Fixes === */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.game-settings-layout {
    width: 100%;
    max-width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
}

.game-profile-card,
.game-collection-summary {
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
}

.level-stats-grid {
    max-width: 100% !important;
    box-sizing: border-box;
}

.difficulty-top5-grid {
    max-width: 100%;
    box-sizing: border-box;
}

/* --- Logo Styles --- */
.login-logo-container {
    width: 100%;
    max-width: 420px;
    /* バランスを考慮して少し拡大 */
    margin: 0 auto 24px auto;
    display: flex;
    justify-content: center;
}

.login-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    /* 木目調背景を適用 */
    background: url('assets/header_wood_bg.jpg') center/cover;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 120px;
    /* 高さを少し増やして木目を見せる */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* オーバーレイ（ロゴの視認性を高める） */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.header-logo-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ロゴを中央配置 */
    flex: 1;
    /* 中央に配置するためにflexを使用 */
    position: relative;
    z-index: 1;
    /* オーバーレイの上に表示 */
}

.header-logo {
    height: 95%;
    /* 高さを調整 */
    width: auto;
    object-fit: contain;
    /* coverからcontainに変更 */
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    /* ロゴに影をつけて視認性向上 */
}

/* ヘッダー内のボタンの視認性確保 */
#fab-add-note.fab-btn {
    background: rgba(255, 255, 255, 0.95);
    /* 少し透明度を上げる */
    color: #5d4037;
    border: 2px solid #8d6e3b;
    font-weight: bold;
    position: relative;
    z-index: 1;
    /* オーバーレイの上に表示 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    /* 影を強調 */
}

.modal-bird-name {
    font-family: 'Sawarabi Mincho', serif;
    font-weight: 900;
    color: #3e2723;
    border-bottom: 1px solid #8d6e63;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.modal-bird-image-container {
    background: white;
    padding: 10px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    transform: rotate(-0.5deg);
    border: 4px solid white;
    margin-bottom: 20px;
}

.modal-bird-info {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #4e342e;
}

.modal-stats {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed #bcaaa4;
}

.stat-bar-container {
    background: #dfd7d0;
    height: 14px;
    border-radius: 0;
    border: 1px solid #c7bdb5;
}

.stat-bar {
    background: #a1887f;
    border-radius: 0;
}

/* ���x���J�b�v�̃N���b�N�\�ȃz�o�[���� */
.level-cup-item[style*="cursor: pointer"]:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.level-cup-item[style*="cursor: pointer"]:hover .cup-container {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.2s ease;
}

/* --- Footer Ad Banner (追従型バナー) --- */
.footer-ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-top: 1px solid #ddd;
    z-index: 10000;
    /* 最前面に配置 */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.ad-content {
    width: 100%;
    max-width: 728px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0 10px;
}

.ad-label {
    position: absolute;
    top: 2px;
    right: 5px;
    font-size: 9px;
    color: #999;
    border: 1px solid #eee;
    padding: 0 3px;
    background: white;
    border-radius: 2px;
}

.ad-placeholder {
    width: 100%;
    height: 85%;
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #666;
    font-size: 0.85rem;
    border-radius: 4px;
}

.close-ad-btn {
    position: absolute;
    top: -12px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: #444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10001;
}


/* コンテンツ被り防止用 */
body.has-ad {
    padding-bottom: 75px !important;
}

/* FABボタンの回避 */
body.has-ad .field-note-fab {
    bottom: 85px !important;
}

/* スマホ対応 */
@media (max-width: 480px) {
    .footer-ad-banner {
        height: 60px;
    }

    .ad-placeholder {
        font-size: 0.75rem;
    }

    body.has-ad {
        padding-bottom: 65px !important;
    }

    body.has-ad .field-note-fab {
        bottom: 75px !important;
    }
}

/* --- Background Test Buttons --- */
.bg-test-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 10px auto 20px;
    padding: 10px;
}

.bg-test-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid white;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.bg-test-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.bg-test-btn.active {
    border-color: #ffeb3b;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 235, 59, 0.6);
}

.bg-test-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
}

.bg-test-btn:hover::after {
    opacity: 1;
}

/* Locked Background Icon */
.bg-test-btn.locked::before {
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    z-index: 3;
    opacity: 0.9;
}



/* --- Overrides for Background Badge Styling --- */
.bg-test-btn.locked::before {
    display: none !important;
}

.bg-level-badge {
    position: absolute;
    bottom: 3px;
    right: 5px;
    background: transparent;
    color: white !important;
    font-family: 'DotGothic16', 'Noto Sans JP', sans-serif !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    text-shadow: 1.5px 1.5px 0 #000, -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 0 1.5px 0 #000, 0 -1.5px 0 #000, 1.5px 0 0 #000, -1.5px 0 0 #000;
    z-index: 2;
    pointer-events: none;
    display: none;
}




/* --- Background Test Buttons Refinement --- */
.bg-test-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
    width: 100%;
}

.bg-test-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid #fff;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, border-color 0.2s;
    padding: 0;
    overflow: hidden;
}

.bg-test-btn:hover {
    transform: scale(1.1);
    z-index: 5;
}

.bg-test-btn.active {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.3);
}

.bg-test-btn.locked {
    filter: grayscale(1) brightness(0.7);
    cursor: not-allowed;
}

.bg-level-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 8px;
    padding: 1px 3px;
    border-top-left-radius: 4px;
    pointer-events: none;
}

/* --- Action Card for Sharing --- */
.action-card {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.action-card-body {
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-card-body:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* --- Email Auth UI --- */
.auth-tab {
    font-size: 0.9rem;
    font-weight: bold;
    color: #666;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--primary-green) !important;
    color: white !important;
}

.action-button-full:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}