/* --- 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: flex-start;
    /* Center -> Flex-start to condense */
    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: flex-start;
    /* Center -> Flex-start */
    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 {
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    /* iOS Widget style */
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    background: #eee;
}

.widget-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.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: 12px;
    border-bottom: 2px solid #eee;
}

.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;
}

/* Order Grid in Modal - maintain grid layout */
.order-filter-container.search-content {
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 12px;
}

.order-filter-container.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;
}

.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: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid #eee;
    animation: fadeIn 0.4s ease;
}

.note-header {
    background: #f9f9f9;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    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 {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.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(auto-fill, minmax(120px, 1fr));
    /* Slightly smaller for timeline */
    gap: 12px;
}

/* 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);
}

.difficulty-btn {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 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-wrap: wrap;
    /* モバイル対応 */
    gap: 20px;
    align-items: stretch;
    /* 高さを揃える */
    justify-content: center;
}

.game-collection-summary,
.game-profile-card {
    flex: 1 1 350px;
    /* 幅を確保しつつ伸縮 */
    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;
    /* Layout側で調整 */
    display: flex;
    flex-direction: column;
}

.game-collection-summary {
    align-items: center;
}

.collection-gauge-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collection-gauge-center {
    position: absolute;
    text-align: center;
}

.collection-percent {
    font-size: 2.2rem;
    font-weight: 900;
    color: #4facfe;
    display: block;
    line-height: 1;
    font-family: 'Roboto', sans-serif;
}

.collection-label {
    font-size: 0.75rem;
    color: #888;
    font-weight: 700;
    letter-spacing: 1px;
}

.collection-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
    margin-top: auto;
    /* 下寄せ */
}

.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;
}

.game-profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e2e8f0;
}

.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;
}