/* ===== CSS Variables ===== */
:root {
    --primary-gold: #FFD700;
    --primary-gold-dark: #E6C200;
    --primary-gold-light: #FFF4CC;
    --accent-orange: #FF8C00;
    --accent-red: #FF4757;
    --accent-green: #2ED573;
    --accent-blue: #3742FA;
    --accent-purple: #8B5CF6;

    --bg-dark: #0D0D12;
    --bg-card: rgba(255, 215, 0, 0.03);
    --bg-card-hover: rgba(255, 215, 0, 0.08);
    --bg-input: rgba(255, 215, 0, 0.05);

    --text-primary: #FFFFFF;
    --text-secondary: #C9B896;
    --text-muted: #8A7F60;

    --gradient-gold: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    --gradient-gold-subtle: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.1) 50%, rgba(255, 215, 0, 0.15) 100%);
    --gradient-fire: linear-gradient(135deg, #FF4757 0%, #FF8C00 100%);
    --gradient-success: linear-gradient(135deg, #2ED573 0%, #1E90FF 100%);
    --gradient-purple: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    --gradient-bg: linear-gradient(180deg, #0D0D12 0%, #1A150D 50%, #0D0D12 100%);
    --gradient-bg-radial: radial-gradient(ellipse at top center, rgba(255, 215, 0, 0.08) 0%, transparent 50%);

    --shadow-gold: 0 4px 20px rgba(255, 215, 0, 0.3);
    --shadow-gold-strong: 0 8px 40px rgba(255, 215, 0, 0.4);
    --shadow-card: 0 4px 20px rgba(255, 215, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(255, 215, 0, 0.25);

    --border-gold: 1px solid rgba(255, 215, 0, 0.2);
    --border-gold-strong: 1px solid rgba(255, 215, 0, 0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    background-image: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-bg-radial);
    pointer-events: none;
    z-index: -1;
}

/* ===== App Container ===== */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(13, 13, 18, 0.98) 0%, rgba(26, 21, 13, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-bottom: var(--border-gold);
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.1);
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Unified Header Navigation ===== */
.header-nav-unified {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--gradient-gold-subtle);
    border-radius: var(--radius-xl);
    border: var(--border-gold);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.nav-item:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    color: var(--primary-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.15) 100%);
    border-color: rgba(255, 215, 0, 0.5);
    color: var(--primary-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
}

.nav-item.streak-link,
.nav-item.visualization-link {
    min-height: 48px;
}

.nav-item.streak-link {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.2) 0%, rgba(255, 140, 0, 0.15) 100%);
    border-color: rgba(255, 71, 87, 0.5);
    font-weight: 700;
}

.nav-item.streak-link:hover {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.3) 0%, rgba(255, 140, 0, 0.25) 100%);
    border-color: rgba(255, 71, 87, 0.7);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

.nav-item .streak-flame {
    font-size: 1.25rem;
    animation: flicker 0.5s ease-in-out infinite alternate;
}

.nav-item .streak-count {
    font-size: 1.25rem;
    font-weight: 900;
    background: var(--gradient-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-item .streak-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Visualization Link - 赤いデザイン */
.nav-item.visualization-link {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.2) 0%, rgba(255, 140, 0, 0.15) 100%);
    border-color: rgba(255, 71, 87, 0.5);
    font-weight: 700;
}

.nav-item.visualization-link:hover {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.3) 0%, rgba(255, 140, 0, 0.25) 100%);
    border-color: rgba(255, 71, 87, 0.7);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

.nav-item.visualization-link.active {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.3) 0%, rgba(255, 140, 0, 0.25) 100%);
    border-color: rgba(255, 71, 87, 0.7);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

.visualization-icon {
    font-size: 1.1rem;
    margin-right: 4px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon-img {
    height: 1.75rem;
    width: auto;
    animation: pulse 2s ease-in-out infinite;
    /* filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5)); モヤ削除 */
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700 0%, #FFF8DC 25%, #FFD700 50%, #FFA500 75%, #FFD700 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    animation: shimmer 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ===== Hamburger Menu Button ===== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary-gold);
    border-radius: 2px;
    transition: var(--transition-fast);
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.streak-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    padding: 10px 20px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.streak-flame {
    font-size: 1.5rem;
    animation: flicker 0.5s ease-in-out infinite alternate;
}

@keyframes flicker {
    0% {
        transform: scale(1) rotate(-5deg);
    }

    100% {
        transform: scale(1.1) rotate(5deg);
    }
}

.streak-count {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-orange);
}

.streak-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== Main Content ===== */
.main-content {
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ===== Section Headers ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.date-display {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== Identity Section ===== */
.identity-section {
    margin-bottom: -16px;
}

.identity-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.12) 50%, rgba(255, 215, 0, 0.2) 100%);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.15), inset 0 0 30px rgba(255, 215, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.identity-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 215, 0, 0.1) 50%, transparent 60%);
    animation: identityShine 4s ease-in-out infinite;
}

@keyframes identityShine {

    0%,
    100% {
        transform: translateX(-100%) rotate(45deg);
    }

    50% {
        transform: translateX(100%) rotate(45deg);
    }
}

.identity-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-gold);
    margin-bottom: 12px;
}

.identity-input-wrapper {
    display: flex;
    gap: 12px;
}

.identity-input {
    flex: 1;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: var(--transition-normal);
}

.identity-input:focus {
    border-color: var(--primary-gold);
    box-shadow: var(--shadow-glow);
}

.identity-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.identity-save-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 215, 0, 0.2);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.identity-save-btn:hover {
    color: var(--primary-gold);
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.05);
}

.identity-save-btn.save-changed {
    color: var(--bg-dark);
    background: var(--gradient-gold);
    border-color: var(--primary-gold);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
    animation: saveGlow 1.5s ease-in-out infinite;
}

/* ===== Today Section ===== */
.today-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 50%, rgba(255, 215, 0, 0.08) 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: var(--border-gold);
    box-shadow: var(--shadow-card), inset 0 0 40px rgba(255, 215, 0, 0.03);
}

.victory-input-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.victory-slots {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.victory-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 2px solid transparent;
    transition: var(--transition-normal);
}

.victory-slot:focus-within {
    border-color: var(--primary-gold);
    box-shadow: var(--shadow-glow);
}

.victory-slot.completed {
    border-color: var(--primary-gold);
    background: rgba(255, 215, 0, 0.1);
}

.slot-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-gold);
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: var(--bg-dark);
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.victory-slot.completed .slot-number {
    background: var(--gradient-gold);
}

.victory-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 12px;
    outline: none;
}

.victory-input::placeholder {
    color: var(--text-muted);
}

.victory-input:disabled {
    opacity: 0.7;
}

.slot-check {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
    font-size: 1.25rem;
    opacity: 0;
    transition: var(--transition-normal);
}

.victory-slot.completed .slot-check {
    opacity: 1;
}

.edit-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* ===== Save Button ===== */
.save-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--gradient-gold);
    color: var(--bg-dark);
    border: none;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-gold);
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
}

.save-btn:active {
    transform: translateY(0);
}

.save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.save-btn.secondary {
    background: var(--gradient-purple);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.save-btn.secondary:hover {
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4);
}

/* Small save button for visualization */
.save-btn.small {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: none;
    align-self: flex-end;
}

.save-btn.small:hover {
    color: var(--primary-gold);
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.1);
    transform: none;
    box-shadow: none;
}

.save-btn.small.save-changed {
    color: var(--bg-dark);
    background: var(--gradient-gold);
    border-color: var(--primary-gold);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
    animation: saveGlow 1.5s ease-in-out infinite;
}

@keyframes saveGlow {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 24px rgba(255, 215, 0, 0.7); }
}

.btn-icon {
    font-size: 1.25rem;
}

/* ===== Stats Section ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.05) 50%, rgba(255, 215, 0, 0.1) 100%);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    border: var(--border-gold);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-gold);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== Medals Section ===== */
.medals-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 50%, rgba(255, 215, 0, 0.08) 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: var(--border-gold);
}

.medals-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 16px;
}

.medal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(255, 165, 0, 0.03) 100%);
    cursor: pointer;
    transition: var(--transition-normal);
    border: 1px solid rgba(255, 215, 0, 0.15);
}

.medal:hover {
    transform: scale(1.05);
}

.medal.earned {
    border: 2px solid var(--primary-gold);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.15) 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.medal.earned:hover {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.medal-icon {
    font-size: 2.5rem;
    filter: grayscale(100%) opacity(0.3);
    transition: var(--transition-normal);
}

.medal.earned .medal-icon {
    filter: none;
    animation: medalShine 3s ease-in-out infinite;
}

@keyframes medalShine {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.medal-name {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
}

.medal.earned .medal-name {
    color: var(--text-secondary);
}

/* Impossible category - ユーモア枠（オレンジ） */
.medal.impossible {
    border: 1px solid rgba(255, 140, 0, 0.35);
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.12) 0%, rgba(255, 99, 71, 0.08) 100%);
}

.medal.impossible .medal-icon {
    filter: grayscale(100%) opacity(0.3);
}

.medal.impossible .medal-name {
    color: var(--text-muted);
}

.medal.impossible:hover {
    border-color: rgba(255, 140, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.18) 0%, rgba(255, 99, 71, 0.12) 100%);
}

/* ===== Calendar Section ===== */
.calendar-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.06) 50%, rgba(255, 215, 0, 0.1) 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: var(--border-gold);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.08);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--primary-gold);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 165, 0, 0.2) 100%);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.calendar-month {
    font-weight: 700;
    min-width: 120px;
    text-align: center;
}

.calendar-container {
    margin-top: 16px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.weekday {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 8px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.06) 0%, rgba(255, 165, 0, 0.04) 100%);
    border: 1px solid rgba(255, 215, 0, 0.1);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    font-size: 0.875rem;
}

.calendar-day:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.1) 100%);
    border-color: rgba(255, 215, 0, 0.3);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day.today {
    border: 2px solid var(--primary-gold);
}

.calendar-day.has-victories {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 140, 0, 0.2) 100%);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3), inset 0 0 8px rgba(255, 215, 0, 0.1);
    animation: calendarGlow 2s ease-in-out infinite alternate;
}

@keyframes calendarGlow {
    0% {
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.2), inset 0 0 6px rgba(255, 215, 0, 0.1);
    }

    100% {
        box-shadow: 0 0 16px rgba(255, 215, 0, 0.4), inset 0 0 10px rgba(255, 215, 0, 0.15);
    }
}

.calendar-day.full-victories {
    background: var(--gradient-gold);
    color: var(--bg-dark);
    font-weight: 700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3);
    animation: fullVictoryGlow 1.5s ease-in-out infinite alternate;
}

@keyframes fullVictoryGlow {
    0% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5), 0 0 30px rgba(255, 215, 0, 0.2);
    }

    100% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.7), 0 0 50px rgba(255, 215, 0, 0.4);
    }
}

.calendar-day .victory-trophies {
    display: flex;
    gap: 0;
    position: absolute;
    bottom: 1px;
    font-size: 0.6rem;
    line-height: 1;
}

.calendar-day.full-victories .victory-trophies {
    font-size: 0.55rem;
}

/* First Record Day - Journey Start */
.calendar-day.first-record {
    position: relative;
    border: 2px solid var(--accent-purple) !important;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.calendar-day.first-record::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    border-radius: inherit;
    pointer-events: none;
}

.first-record-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1rem;
    background: var(--gradient-purple);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.6);
    animation: firstRecordPulse 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes firstRecordPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.first-record-label {
    font-size: 0.55rem;
    color: var(--accent-purple);
    white-space: nowrap;
    line-height: 1;
    margin-top: 1px;
}

/* ===== History Section ===== */
.history-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 50%, rgba(255, 215, 0, 0.08) 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: var(--border-gold);
}

.history-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.1) 100%);
    border-color: rgba(255, 215, 0, 0.4);
}

.filter-btn.active {
    background: var(--gradient-gold);
    color: var(--bg-dark);
    font-weight: 700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.timeline {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.timeline::-webkit-scrollbar {
    width: 6px;
}

.timeline::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 3px;
}

.timeline::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 3px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 100%);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-gold);
    transition: var(--transition-normal);
    border-top: 1px solid rgba(255, 215, 0, 0.1);
    border-right: 1px solid rgba(255, 215, 0, 0.1);
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.timeline-item:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.1) 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.timeline-date {
    flex-shrink: 0;
    text-align: center;
    min-width: 60px;
}

.timeline-day {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-gold);
}

.timeline-month {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-content {
    flex: 1;
}

.timeline-victories {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-victory {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.timeline-victory::before {
    content: "🏆";
    font-size: 0.875rem;
}

.timeline-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* ===== Hero Section (Winner Effect Explanation) ===== */
.hero-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    margin-bottom: 20px;
}

.hero-description p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.8;
}

.hero-lead {
    font-size: 1.25rem;
    color: var(--text-primary) !important;
    text-align: center;
    padding: 16px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-gold);
}

.hero-description .highlight {
    color: var(--primary-gold);
    font-weight: 700;
}

.learn-more-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    margin: 0 auto;
}

.learn-more-btn:hover {
    background: rgba(255, 215, 0, 0.1);
}

.learn-more-btn .arrow {
    transition: var(--transition-normal);
}

.learn-more-btn.expanded .arrow {
    transform: rotate(180deg);
}

.hero-expanded {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.hero-expanded.active {
    max-height: 800px;
    margin-top: 24px;
}

.info-cards {
    display: grid;
    gap: 16px;
}

@media (min-width: 600px) {
    .info-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.info-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 100%);
    border-radius: var(--radius-md);
    padding: 20px;
    border: var(--border-gold);
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.info-card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--primary-gold);
}

.info-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Victory Examples ===== */
.victory-examples {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.examples-title {
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (min-width: 600px) {
    .examples-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.example-category {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.category-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 4px;
}

.category-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-gold);
    display: block;
    margin-bottom: 8px;
}

.example-category ul {
    list-style: none;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.example-category li {
    margin-bottom: 4px;
}

.example-category li::before {
    content: "・";
    color: var(--primary-gold);
}

.examples-note {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: rgba(255, 215, 0, 0.05);
    padding: 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-gold);
}

/* ===== Medal Categories Filter ===== */
.medal-counter {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.medal-counter span:first-child {
    color: var(--primary-gold);
    font-weight: 700;
}

.medal-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.medal-filter-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.medal-filter-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.1) 100%);
    border-color: rgba(255, 215, 0, 0.4);
}

.medal-filter-btn.active {
    background: var(--gradient-gold);
    color: var(--bg-dark);
    font-weight: 700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* ===== Visualization Section ===== */
.visualization-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 50%, rgba(255, 215, 0, 0.08) 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: var(--border-gold);
    box-shadow: var(--shadow-card);
}

.visualization-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.visualization-explanation {
    background: rgba(139, 92, 246, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 8px;
}

.visualization-title {
    font-weight: 700;
    color: var(--accent-purple);
    margin-bottom: 12px;
}

.visualization-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.8;
    margin-bottom: 8px;
}

.visualization-text.highlight-box {
    background: rgba(139, 92, 246, 0.2);
    padding: 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-purple);
    margin-top: 12px;
    margin-bottom: 0;
}

.visualization-intro {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.8;
}

.visualization-input {
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    min-height: 300px;
    resize: none;
    overflow: hidden;
    transition: var(--transition-normal);
    field-sizing: content;
}

.visualization-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: var(--shadow-glow);
}

.visualization-input::placeholder {
    color: var(--text-muted);
}

/* ===== Strategies Section ===== */
.strategies-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.strategies-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 600px) {
    .strategies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.strategy-card {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-normal);
}

.strategy-card:hover {
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.strategy-card:last-child {
    grid-column: span 1;
}

@media (min-width: 600px) {
    .strategy-card:last-child {
        grid-column: span 2;
    }
}

.strategy-number {
    position: absolute;
    top: -10px;
    left: 20px;
    width: 32px;
    height: 32px;
    background: var(--gradient-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: var(--bg-dark);
    font-size: 0.875rem;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.strategy-card h4 {
    margin-top: 8px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 1rem;
}

.strategy-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ===== Motivation Section ===== */
.motivation-section {
    margin-top: 8px;
}

.motivation-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.1) 50%, rgba(255, 215, 0, 0.15) 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}

.motivation-quote {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.motivation-text {
    color: var(--text-secondary);
    line-height: 2;
    font-size: 0.95rem;
}

/* Famous Quote Section */
.famous-quote-section {
    margin-bottom: 32px;
}

.famous-quote-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 140, 0, 0.15) 50%, rgba(255, 215, 0, 0.2) 100%);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow:
        0 0 40px rgba(255, 215, 0, 0.3),
        0 0 80px rgba(255, 215, 0, 0.15),
        inset 0 0 40px rgba(255, 215, 0, 0.1);
    position: relative;
    overflow: hidden;
    animation: quoteGlow 3s ease-in-out infinite alternate;
}

@keyframes quoteGlow {
    0% {
        box-shadow:
            0 0 30px rgba(255, 215, 0, 0.25),
            0 0 60px rgba(255, 215, 0, 0.1),
            inset 0 0 30px rgba(255, 215, 0, 0.08);
    }

    100% {
        box-shadow:
            0 0 50px rgba(255, 215, 0, 0.4),
            0 0 100px rgba(255, 215, 0, 0.2),
            inset 0 0 50px rgba(255, 215, 0, 0.15);
    }
}

.famous-quote-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 215, 0, 0.15) 50%, transparent 60%);
    animation: quoteShine 4s ease-in-out infinite;
}

@keyframes quoteShine {

    0%,
    100% {
        transform: translateX(-100%) rotate(45deg);
    }

    50% {
        transform: translateX(100%) rotate(45deg);
    }
}

.famous-quote-text {
    position: relative;
    z-index: 1;
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.6;
    background: linear-gradient(135deg, #FFD700 0%, #FFF8DC 25%, #FFD700 50%, #FFA500 75%, #FFD700 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    margin-bottom: 16px;
}

.famous-quote-author {
    position: relative;
    z-index: 1;
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.famous-quote-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: normal;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    border-top: var(--border-gold);
    margin-top: 24px;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 215, 0, 0.03) 100%);
    width: 100%;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.footer-nav a:hover {
    color: var(--primary-gold);
}

.footer-settings-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    transition: var(--transition-fast);
}

.footer-settings-btn:hover {
    color: var(--primary-gold);
}

.footer-nav .streak-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.footer-nav .streak-link .streak-count {
    font-size: 0.875rem;
}

.footer p {
    font-size: 0.875rem;
}

.footer-sub {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Tokushoho Modal ===== */
.tokushoho-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.tokushoho-overlay.active {
    display: flex;
}

.tokushoho-modal {
    background: #1a1a1f;
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

.tokushoho-modal h3 {
    font-size: 1.2rem;
    color: var(--primary-gold);
    margin-bottom: 24px;
    text-align: center;
}

.tokushoho-modal table {
    width: 100%;
    border-collapse: collapse;
}

.tokushoho-modal th,
.tokushoho-modal td {
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    vertical-align: top;
}

.tokushoho-modal th {
    color: var(--text-primary);
    white-space: nowrap;
    width: 140px;
    font-weight: 600;
}

.tokushoho-modal td a {
    color: var(--primary-gold);
    text-decoration: none;
}

.tokushoho-modal td a:hover {
    text-decoration: underline;
}

.tokushoho-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.tokushoho-close:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .footer-nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px 8px;
        text-align: center;
    }

    .footer-nav a,
    .footer-nav .footer-settings-btn {
        font-size: 0.75rem;
        justify-content: center;
    }

    .footer-nav .streak-link {
        justify-content: center;
    }

    .tokushoho-modal {
        padding: 24px 16px;
    }

    .tokushoho-modal th {
        width: 110px;
        font-size: 0.8rem;
    }

    .tokushoho-modal td {
        font-size: 0.8rem;
    }
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #1A150D 0%, #0D0D12 50%, #1A150D 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: var(--transition-normal);
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.2);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.celebration-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 0.5s ease infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-close-btn {
    background: var(--gradient-gold);
    color: var(--bg-dark);
    border: none;
    padding: 12px 32px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-normal);
}

.modal-close-btn:hover {
    transform: scale(1.05);
}

.medal-detail-icon {
    font-size: 5rem;
    margin-bottom: 16px;
}

.medal-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.day-detail h3 {
    margin-bottom: 4px;
}

.day-detail-first-record {
    display: none;
    font-size: 0.8rem;
    color: var(--accent-purple);
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.day-detail-first-record.show {
    display: block;
}

.day-victories {
    text-align: left;
}

.day-victory-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.06) 100%);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.day-victory-item span:first-child {
    font-size: 1.25rem;
}

/* ===== Edit Victories Modal ===== */
.edit-victories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.edit-victory-slot {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 100%);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 2px solid rgba(255, 215, 0, 0.15);
    transition: var(--transition-normal);
}

.edit-victory-slot:focus-within {
    border-color: var(--primary-gold);
    box-shadow: var(--shadow-glow);
}

.edit-victory-slot.has-value {
    border-color: var(--primary-gold);
    background: rgba(255, 215, 0, 0.1);
}

.edit-slot-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-gold);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--bg-dark);
    flex-shrink: 0;
}

.edit-victory-slot.has-value .edit-slot-number {
    background: var(--gradient-gold);
}

.edit-victory-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 10px;
    outline: none;
}

.edit-victory-input::placeholder {
    color: var(--text-muted);
}

.edit-save-btn {
    width: 100%;
    margin-top: 8px;
}

.edit-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 12px;
    text-align: center;
}

.edit-note.readonly {
    color: var(--accent-red);
    opacity: 0.7;
}

/* ===== Logout Button ===== */
.logout-btn {
    display: block;
    margin: 0 auto 8px auto;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-normal);
}

.logout-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

/* ===== Reset Button & Modal ===== */
.reset-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 71, 87, 0.3);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-normal);
    margin-top: 12px;
    margin-bottom: 16px;
}

.reset-btn:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background: rgba(255, 71, 87, 0.1);
}

.reset-modal {
    max-width: 400px;
}

.reset-warning {
    color: var(--accent-red);
    font-size: 0.875rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.reset-step {
    margin-bottom: 16px;
}

.reset-step.hidden {
    display: none;
}

.reset-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.reset-checkbox-label:hover {
    border-color: rgba(255, 71, 87, 0.5);
}

.reset-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-red);
}

.reset-checkbox-label span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.reset-input-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reset-input-label span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.reset-input-label input {
    background: var(--bg-input);
    border: 2px solid rgba(255, 71, 87, 0.3);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: monospace;
    transition: var(--transition-normal);
}

.reset-input-label input:focus {
    outline: none;
    border-color: var(--accent-red);
}

.reset-input-label input::placeholder {
    color: var(--text-muted);
}

.reset-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.reset-cancel-btn {
    flex: 1;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.reset-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.reset-confirm-btn {
    flex: 1;
    background: rgba(255, 71, 87, 0.2);
    color: var(--text-muted);
    border: 1px solid rgba(255, 71, 87, 0.3);
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: not-allowed;
    transition: var(--transition-normal);
}

.reset-confirm-btn:not(:disabled) {
    background: var(--accent-red);
    color: white;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

.reset-confirm-btn:not(:disabled):hover {
    box-shadow: 0 0 30px rgba(255, 71, 87, 0.6);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    font-size: 2rem;
    animation: confetti 1s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
}

/* ===== Header Navigation ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-nav {
    display: flex;
    gap: 12px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-gold);
    background: rgba(255, 215, 0, 0.1);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

/* ===== Quick Links ===== */
.quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .quick-links {
        grid-template-columns: 1fr;
    }
}

.quick-link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.06) 100%);
    border-radius: var(--radius-md);
    border: var(--border-gold);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-normal);
}

.quick-link-card:hover {
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.quick-link-icon {
    font-size: 1.5rem;
}

.quick-link-text {
    flex: 1;
    font-size: 0.875rem;
}

.quick-link-arrow {
    color: var(--text-muted);
}

/* ===== Victory Examples Details ===== */
.victory-examples-details {
    margin-top: 16px;
}

.examples-summary {
    cursor: pointer;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    list-style: none;
    transition: var(--transition-fast);
}

.examples-summary::-webkit-details-marker {
    display: none;
}

.examples-summary:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.1) 100%);
    border-color: rgba(255, 215, 0, 0.3);
    color: var(--primary-gold);
}

.victory-examples-details[open] .examples-summary {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.victory-examples-details .victory-examples {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.06) 0%, rgba(255, 165, 0, 0.04) 100%);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 16px;
    margin-top: -1px;
}

/* ===== CTA Button ===== */
.cta-section {
    text-align: center;
    padding: 24px 0;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--gradient-gold);
    color: var(--bg-dark);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-gold);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
}

.cta-btn.secondary {
    background: var(--gradient-purple);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.cta-icon {
    font-size: 1.25rem;
}

/* ===== About Page ===== */
.about-page {
    padding-bottom: 40px;
}

.about-hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.1) 50%, rgba(255, 215, 0, 0.15) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    border: var(--border-gold);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.1);
}

.about-title {
    font-size: 1.75rem;
    font-weight: 900;
    margin-bottom: 20px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-lead {
    font-size: 1.25rem;
    color: var(--text-primary);
    padding: 16px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-gold);
    display: inline-block;
}

.about-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: var(--primary-gold);
}

.about-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 50%, rgba(255, 215, 0, 0.08) 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: var(--border-gold);
}

.about-card h3 {
    font-size: 1.125rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.about-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.8;
}

.about-card ul.howto-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.about-card ul.howto-list li {
    color: var(--text-secondary);
    padding: 8px 0;
    line-height: 1.7;
    border-bottom: 1px solid rgba(255, 215, 0, 0.06);
}

.about-card ul.howto-list li:last-child {
    border-bottom: none;
}

.about-card ul.howto-tips li {
    padding-left: 8px;
}

.highlight-box {
    background: rgba(255, 215, 0, 0.1);
    border-left: 4px solid var(--primary-gold);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.highlight-box.green {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--primary-gold);
}

.text-gold {
    color: var(--primary-gold);
    font-weight: 700;
}

.text-green {
    color: var(--primary-gold);
    font-weight: 700;
}

/* Science Points */
.science-points {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.science-point {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.06) 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 215, 0, 0.15);
}

.point-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.science-point strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.science-point p {
    margin: 0;
    font-size: 0.875rem;
}

.result-text {
    font-size: 1rem;
    text-align: center;
    padding: 16px;
    background: rgba(255, 215, 0, 0.05);
    border-radius: var(--radius-md);
}

/* Stat Highlight */
.stat-highlight {
    text-align: center;
    padding: 24px;
    margin: 20px 0;
}

.big-number {
    font-size: 4rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-desc {
    display: block;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Comparison Box */
.comparison-box {
    display: grid;
    gap: 16px;
    margin: 20px 0;
}

@media (min-width: 600px) {
    .comparison-box {
        grid-template-columns: repeat(2, 1fr);
    }
}

.comparison-item {
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
}

.comparison-item.winner {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--primary-gold);
}

.comparison-item.winner strong {
    color: var(--primary-gold);
}

.comparison-item.loser {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--accent-red);
}

.comparison-item.loser strong {
    color: var(--accent-red);
}

.comparison-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.comparison-item strong {
    display: block;
    margin-bottom: 8px;
}

.comparison-item p {
    font-size: 0.875rem;
    margin: 0;
    text-align: left;
}

.insight {
    font-style: italic;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 16px;
}

/* Strategies List */
.strategies-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.strategy-item {
    display: flex;
    gap: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 50%, rgba(255, 215, 0, 0.08) 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: var(--border-gold);
}

.strategy-item .strategy-number {
    position: static;
    flex-shrink: 0;
}

.strategy-content h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.strategy-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.8;
    margin-bottom: 12px;
}

.strategy-content .note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.example-list {
    list-style: none;
    margin: 12px 0;
    padding-left: 0;
}

.example-list li {
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 165, 0, 0.05) 100%);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.example-list li::before {
    content: "• ";
    color: var(--primary-gold);
}

.comparison-inline {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.comparison-inline .bad {
    padding: 8px 16px;
    background: rgba(255, 71, 87, 0.1);
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    font-size: 0.875rem;
}

.comparison-inline .good {
    padding: 8px 16px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: var(--radius-sm);
    color: var(--primary-gold);
    font-size: 0.875rem;
}

.quote-box {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-left: 4px solid var(--primary-gold);
    border-radius: var(--radius-sm);
    font-style: italic;
    color: var(--text-secondary);
    margin: 16px 0;
}

/* ===== Visualization Page ===== */
.visualization-page {
    padding-bottom: 40px;
}

.visualization-page .identity-section {
    margin-bottom: 24px;
}

/* ===== Medals Page ===== */
.medals-page {
    padding-bottom: 40px;
}

.page-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 24px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.medals-summary {
    text-align: center;
    padding: 32px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 165, 0, 0.08) 50%, rgba(255, 215, 0, 0.12) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    border: var(--border-gold);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.1);
}

.medals-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.progress-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--primary-gold) 0deg, rgba(255, 215, 0, 0.1) 0deg);
    position: relative;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #1A150D 0%, #0D0D12 100%);
    border-radius: 50%;
}

.progress-value {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-gold);
}

.progress-text {
    font-size: 1rem;
}

.earned-count {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-gold);
}

.total-count {
    color: var(--text-muted);
}

.medal-filters {
    margin-bottom: 24px;
}

.medals-page .medal-categories {
    justify-content: center;
}

.medals-page .medals-section {
    background: transparent;
    border: none;
    padding: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .header-content {
        flex-direction: row;
        position: relative;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .header-nav-unified {
        display: none;
        position: absolute;
        top: 100%;
        left: -20px;
        right: -20px;
        flex-direction: column;
        background: linear-gradient(180deg, rgba(13, 13, 18, 0.98) 0%, rgba(26, 21, 13, 0.98) 100%);
        backdrop-filter: blur(10px);
        border-bottom: var(--border-gold);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
        padding: 16px 20px;
        gap: 8px;
        z-index: 100;
    }

    .header-nav-unified.open {
        display: flex;
    }

    .nav-item {
        padding: 12px 16px;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }

    .nav-item .streak-count {
        font-size: 1.1rem;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .strategy-item {
        flex-direction: column;
    }

    .strategy-item .strategy-number {
        align-self: flex-start;
    }

    /* モバイル: カレンダー内の「初記録日」ラベルを非表示 */
    .first-record-label {
        display: none;
    }

    /* モバイル: アイデンティティ入力を縦並びに */
    .identity-input-wrapper {
        flex-direction: column;
    }

    .identity-save-btn {
        align-self: flex-end;
    }

    /* モバイル: メダルフィルタータブを横幅いっぱいに */
    .medal-categories {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .medal-filter-btn {
        text-align: center;
    }

    /* モバイル: カレンダーのトロフィーを小さく */
    .calendar-day .victory-trophies {
        font-size: 0.45rem;
        bottom: 0;
    }

    .calendar-day.full-victories .victory-trophies {
        font-size: 0.4rem;
    }

    .calendar-day {
        font-size: 0.75rem;
    }

    .first-record-badge {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        top: -8px;
        right: -8px;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        font-size: 1.5rem;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar-nav {
        width: 100%;
        justify-content: space-between;
    }

    .history-filters {
        width: 100%;
        justify-content: center;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .medals-container {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .about-title {
        font-size: 1.25rem;
    }

    .big-number {
        font-size: 3rem;
    }
}

/* ===== Scroll to Top Button (Mobile Only) ===== */
.scroll-to-top {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9) 0%, rgba(255, 165, 0, 0.9) 100%);
    border: none;
    color: #0D0D12;
    font-size: 1.25rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
    z-index: 90;
    transition: var(--transition-fast);
    opacity: 0;
    pointer-events: none;
}

.scroll-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .scroll-to-top {
        display: block;
    }
}

/* ===== Common Footer Styles ===== */
.footer-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.footer-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.footer-btn:hover {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
    background: rgba(255, 215, 0, 0.05);
}

.footer-btn.danger:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(255, 71, 87, 0.05);
}

.footer-brand {
    text-align: center;
    margin-bottom: 16px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-secondary);
    /* シンプルな色に変更 */
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-logo:hover {
    color: var(--primary-gold);
}

.footer-logo-icon {
    width: 1.5rem;
    height: 1.5rem;
    /* 影などは削除 */
}

/* Settings Modal */
.modal-content.settings-modal {
    position: relative;
    max-width: 420px;
    padding: 32px;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-close-x {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
    line-height: 1;
    padding: 0;
    margin: 0;
}

.settings-close-x:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.settings-group {
    margin-bottom: 24px;
}

.settings-label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.settings-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    appearance: none;
    cursor: pointer;
}

.settings-select:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: rgba(255, 215, 0, 0.05);
}


.settings-logout-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #FF453A;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
}

.settings-logout-btn:hover {
    background: rgba(255, 71, 87, 0.1);
    border-color: #FF453A;
}

/* ===== Settings Trigger Button (nav) ===== */
.settings-trigger {
    background: var(--gradient-gold-subtle) !important;
    border: var(--border-gold) !important;
    border-radius: var(--radius-xl) !important;
    color: var(--text-secondary) !important;
    font-size: 0.875rem !important;
    font-family: 'Noto Sans JP', sans-serif;
    cursor: pointer;
    padding: 10px 16px !important;
    transition: var(--transition-fast);
}

.settings-trigger:hover {
    background: rgba(255, 215, 0, 0.15) !important;
    border-color: rgba(255, 215, 0, 0.4) !important;
    color: var(--primary-gold) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* ===== Settings Modal Extended ===== */
.settings-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.settings-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 4px 0 12px;
}

.settings-action-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--primary-gold);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
}

.settings-action-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--primary-gold);
}

.settings-status {
    font-size: 0.8rem;
    margin-top: 8px;
    min-height: 1.2em;
    text-align: center;
}

.settings-status.success {
    color: var(--accent-green);
}

.settings-status.error {
    color: var(--accent-red);
}

.settings-danger-group {
    border-top: 1px solid rgba(255, 71, 87, 0.15);
    padding-top: 16px;
}

.settings-reset-quiet {
    margin-top: 32px;
    text-align: center;
}

.settings-reset-link {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.settings-reset-link:hover {
    color: var(--accent-red);
}

.settings-reset-quiet + .settings-reset-quiet {
    margin-top: 16px;
}

.settings-danger-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #FF453A;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
}

.settings-danger-btn:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: #FF453A;
}

.settings-danger-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.settings-warning {
    font-size: 0.8rem;
    color: #FF453A;
    margin: 12px 0 8px;
    line-height: 1.5;
}

.settings-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 8px 0;
}

.settings-check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #FF453A;
}

.settings-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 8px 0;
    box-sizing: border-box;
}

.settings-input:focus {
    outline: none;
    border-color: #FF453A;
    background: rgba(255, 71, 87, 0.05);
}

.hidden {
    display: none !important;
}

/* ===== MyPage Styles ===== */
.mypage-profile-section {
    margin-bottom: 2rem;
}

.mypage-profile-card {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border: var(--border-gold);
    border-radius: var(--radius-lg);
}

.mypage-avatar-display {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.mypage-username-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0.25rem;
}

.mypage-username-display {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-gold);
}

.mypage-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 2px 4px;
    line-height: 1;
}

.mypage-edit-btn:hover {
    opacity: 1;
}

.mypage-username-edit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0.25rem;
}

.mypage-username-input {
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--primary-gold);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    width: 200px;
    outline: none;
}

.mypage-username-input:focus {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.mypage-username-save-btn,
.mypage-username-cancel-btn {
    background: none;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 10px;
    transition: var(--transition-fast);
}

.mypage-username-save-btn:hover {
    background: rgba(50, 215, 75, 0.2);
    border-color: #32D74B;
    color: #32D74B;
}

.mypage-username-cancel-btn:hover {
    background: rgba(255, 69, 58, 0.2);
    border-color: #FF453A;
    color: #FF453A;
}

.mypage-email-display {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.mypage-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 4px 14px;
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 20px;
    font-size: 0.75rem;
}

.mypage-plan-label {
    color: var(--text-muted);
}

.mypage-plan-value {
    color: var(--text-secondary);
    font-weight: 700;
}

.mypage-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: var(--border-gold);
    border-radius: var(--radius-lg);
}

.mypage-label {
    display: block;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.mypage-section-title {
    font-weight: 900;
    color: var(--primary-gold);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.mypage-input-wrapper {
    display: flex;
    gap: 8px;
}

.mypage-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: var(--border-gold);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
}

.mypage-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: rgba(255, 215, 0, 0.1);
}

.mypage-save-btn {
    padding: 10px 20px;
    background: var(--gradient-gold);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg-dark);
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.mypage-save-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.mypage-avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
}

.avatar-option {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.avatar-option:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    transform: scale(1.1);
}

.avatar-option.selected {
    border-color: var(--primary-gold);
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

/* Video embed */
.video-wrapper {
    max-width: 640px;
    margin: 0 auto;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-credit {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

.video-credit a {
    color: var(--primary-gold);
    text-decoration: underline;
}

.video-credit a:hover {
    color: var(--primary-gold);
}

/* Language reload overlay */
.language-reload-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: background 0.3s ease;
}

.language-reload-overlay.active {
    background: rgba(10, 10, 15, 0.95);
}

.language-reload-content {
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.language-reload-overlay.active .language-reload-content {
    opacity: 1;
    transform: scale(1);
}

.language-reload-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 16px;
}

.language-reload-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 215, 0, 0.2);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    margin: 0 auto;
    animation: lang-spin 0.7s linear infinite;
}

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