:root {
    --bg-color: #f8fafc;
    --text-main: #334155;
    --text-muted: #64748b;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --accent-yellow: #f59e0b;
    --accent-green: #10b981;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --timeline-color: #cbd5e1;

    --font-heading: 'M PLUS Rounded 1c', sans-serif;
    --font-body: 'Kiwi Maru', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

/* 楽しい背景パターン (Polka dots) */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image: radial-gradient(var(--timeline-color) 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    opacity: 0.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.relative {
    position: relative;
}

/* --- Hero Section --- */
.hero {
    height: 50vh;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.ticket-stamp {
    display: inline-block;
    padding: 6px 20px;
    border: 2px dashed var(--accent-red);
    color: var(--accent-red);
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 2px;
    border-radius: 8px;
    transform: rotate(-3deg);
    margin-bottom: 20px;
    background: #fff;
    box-shadow: 2px 2px 0 var(--accent-red);
    animation: stampIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stampIn {
    0% {
        transform: scale(2) rotate(-20deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(-3deg);
        opacity: 1;
    }
}

.title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 15px;
}

.bounce-letter {
    display: inline-block;
    animation: letterBounce 2s infinite alternate;
    animation-delay: var(--delay);
}

@keyframes letterBounce {

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

    50% {
        transform: translateY(-8px);
        color: var(--accent-blue);
    }
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.scroll-down {
    position: absolute;
    bottom: 5px;
    /* Changed from -15px to prevent clipping */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: var(--accent-blue);
    animation: bounce 2s infinite;
}

.arrow {
    font-size: 1.5rem;
    background: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

@keyframes bounce {

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

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

    60% {
        transform: translateY(-5px);
    }
}

/* --- Scrolling Animations (Sea & Train - Header Only) --- */
.hero {
    overflow: hidden;
    /* Prevent animations from spilling out */
}

/* Sea & Ship (Footer Only) */
.site-footer {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 60px 0 30px;
    /* Added padding to fit the wave */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border-top: 1px solid #e2e8f0;
}

.insurance-card {
    position: relative;
    z-index: 2;
    display: inline-block;
    background: #fff;
    border: 2px dashed var(--accent-green);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.insurance-card i {
    color: var(--accent-green);
    margin-right: 4px;
}

.footer-text {
    position: relative;
    z-index: 2;
    color: var(--text-main);
    font-weight: bold;
    font-family: var(--font-heading);
}

.footer-sea-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    opacity: 0.5;
    z-index: 1;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 800 120" xmlns="http://www.w3.org/2000/svg"><path d="M0,60 Q100,20 200,60 T400,60 T600,60 T800,60 L800,120 L0,120 Z" fill="%233b82f6" opacity="0.4"/></svg>') repeat-x;
    background-size: 800px 120px;
    animation: waveScroll 15s linear infinite;
}

.wave-2 {
    bottom: -10px;
    opacity: 0.6;
    animation: waveScroll 10s linear infinite reverse;
}

@keyframes waveScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-800px);
    }
}

.animated-ship {
    position: absolute;
    bottom: 40px;
    left: 20%;
    font-size: 3rem;
    color: var(--accent-blue);
    animation: shipBob 3s ease-in-out infinite, shipMove 40s linear infinite;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

@keyframes shipBob {

    0%,
    100% {
        transform: translateY(0) rotate(-3deg);
    }

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

@keyframes shipMove {
    0% {
        left: -10%;
    }

    100% {
        left: 110%;
    }
}

/* Train & Track */
.header-track-layer {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 60px;
    opacity: 0.8;
    z-index: 1;
}

.train-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 8px;
    background-image:
        linear-gradient(to right, transparent 50%, var(--text-muted) 50%),
        linear-gradient(to bottom, var(--text-muted) 2px, transparent 2px, transparent 6px, var(--text-muted) 6px);
    background-size: 30px 100%, 100% 100%;
    animation: trackScroll 2s linear infinite;
}

@keyframes trackScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-30px);
    }
}

.animated-train-wrapper {
    position: absolute;
    bottom: 8px;
    /* trackの上 */
    right: 20%;
    display: flex;
    align-items: flex-end;
    animation: trainMove 25s linear infinite backwards;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.train-car {
    width: 40px;
    height: 24px;
    background-color: var(--accent-red);
    border-radius: 4px;
    position: relative;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding-bottom: 4px;
    animation: trainBump 0.5s ease-in-out infinite;
}

.train-head {
    border-top-left-radius: 12px;
}

.train-car .window {
    width: 12px;
    height: 10px;
    background-color: #f8fafc;
    border-radius: 2px;
}

.train-car .wheel {
    width: 8px;
    height: 8px;
    background-color: #334155;
    border-radius: 50%;
    position: absolute;
    bottom: -4px;
}

.wheel-left {
    left: 6px;
}

.wheel-right {
    right: 6px;
}

.train-connector {
    width: 4px;
    height: 3px;
    background-color: #cbd5e1;
    margin-bottom: 4px;
    /* 連結器の高さ */
}

/* 個別に振動をずらす */
.train-car:nth-child(1) {
    animation-delay: 0s;
}

.train-car:nth-child(3) {
    animation-delay: 0.1s;
}

.train-car:nth-child(5) {
    animation-delay: 0.2s;
}

@keyframes trainBump {

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

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

@keyframes trainMove {
    0% {
        right: -20%;
    }

    100% {
        right: 110%;
    }
}


/* --- List Layout Section --- */
.itinerary-list {
    padding: 40px 0 60px;
}

.list-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 各行のデザイン（横長の読みやすいカード） */
.day-row {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px;
    /* Reduced for mobile */
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Reduced for mobile */
    border-left: 6px solid var(--accent-blue);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    opacity: 0;
    transform: translateY(20px);
}

.day-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.day-row:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
    .day-row {
        padding: 24px;
        /* Restore desktop padding */
        gap: 20px;
        /* Restore desktop gap */
        flex-direction: row;
        align-items: stretch;
    }
}

/* カードにカラフルな色合いを交互につける */
.day-row:nth-child(4n+1) {
    border-left-color: var(--accent-blue);
}

.day-row:nth-child(4n+2) {
    border-left-color: var(--accent-red);
}

.day-row:nth-child(4n+3) {
    border-left-color: var(--accent-yellow);
}

.day-row:nth-child(4n+4) {
    border-left-color: var(--accent-green);
}

/* --- Alert Row --- */
.alert-row {
    background: #fffbeb;
    border: 2px dashed #f59e0b;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.5s ease;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
}

.alert-row::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 40px;
    width: 2px;
    height: 12px;
    background-color: var(--timeline-color);
}

.alert-row::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 40px;
    width: 2px;
    height: 12px;
    background-color: var(--timeline-color);
}

.alert-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.alert-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(245, 158, 11, 0.15);
}

.alert-icon {
    font-size: 2.5rem;
    color: #f59e0b;
    animation: tipWobble 4s infinite ease-in-out;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 1.15rem;
    font-family: var(--font-heading);
    margin-bottom: 4px;
    font-weight: bold;
    color: #b45309;
}

.alert-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #92400e;
}


/* --- 左側：日程とタイトル --- */
.row-header {
    flex: 0 0 auto;
    /* Changed from 250px for mobile */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-bottom: 2px dashed #f1f5f9;
    padding-bottom: 12px;
}

@media (min-width: 768px) {
    .row-header {
        flex: 0 0 250px;
        /* Restore fixed width for desktop */
        border-bottom: none;
        border-right: 2px dashed #f1f5f9;
        padding-bottom: 0;
        padding-right: 20px;
    }
}

.row-date-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.row-icon {
    font-size: 1.8rem;
    color: var(--text-main);
    animation: tipWobble 4s infinite ease-in-out;
}

.location-icon {
    color: var(--accent-red);
    margin-right: 4px;
}

.time-icon {
    color: var(--accent-yellow);
    margin-right: 6px;
}

.external-icon {
    font-size: 0.8em;
    margin-left: 4px;
    opacity: 0.7;
}

.row-date {
    display: inline-block;
    background: #f1f5f9;
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}

.row-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 5px;
    line-height: 1.3;
}

.row-location {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* --- 右側：イベントリスト --- */
.row-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.event-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    padding: 10px 15px;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.event-item:hover {
    background: #f1f5f9;
}

.event-item.highlight {
    background: #fef2f2;
    border-left: 4px solid var(--accent-red);
}

.event-item.hotel {
    background: #eff6ff;
    border-left: 4px solid var(--accent-blue);
    font-weight: bold;
}

.event-time {
    font-weight: 700;
    color: var(--accent-blue);
    min-width: 60px;
    font-size: 0.95rem;
}

.event-item.highlight .event-time {
    color: var(--accent-red);
}

.event-desc {
    color: var(--text-main);
    line-height: 1.5;
    flex-grow: 1;
}

.event-note {
    font-size: 0.85em;
    color: var(--text-muted);
    font-weight: normal;
    margin-top: 4px;
}


/* --- Tips Section --- */
.tips-section {
    padding: 20px 0 80px;
}

.tips-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: 2px dashed var(--accent-yellow);
    text-align: center;
}

.tips-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: inline-block;
}

.tips-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
    font-size: 0.95rem;
}

.tips-list li {
    position: relative;
    padding-left: 28px;
    color: var(--text-muted);
}

.tips-list li::before {
    content: '📌';
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 1rem;
}

.tips-list strong {
    color: var(--text-main);
}

/* Links */
.hotel-link {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, background-color 0.2s;
    border-radius: 4px;
    padding: 2px 4px;
    margin-left: -4px;
}

.hotel-link:hover {
    background: rgba(59, 130, 246, 0.1);
    border-bottom-color: var(--accent-blue);
}

/* --- Transit Dropdown --- */
.has-transit {
    cursor: pointer;
    position: relative;
}

.transit-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.transit-toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
    font-size: 0.9em;
}

.has-transit.expanded .transit-toggle-icon {
    transform: rotate(180deg);
}

.transit-container {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.has-transit.expanded .transit-container {
    grid-template-rows: 1fr;
}

.transit-details {
    overflow: hidden;
    position: relative;
    padding-left: 12px;
    margin-top: 0px;
    /* adjusted when expanded via padding */
}

.has-transit.expanded .transit-details {
    padding-top: 12px;
    padding-bottom: 4px;
}

.transit-line {
    position: absolute;
    left: 4px;
    top: 16px;
    bottom: 12px;
    width: 2px;
    background-color: var(--timeline-color);
    border-radius: 2px;
}

.transit-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    font-size: 0.9em;
    position: relative;
    padding: 4px 0;
}

.transit-step.station::before,
.transit-step.train::before {
    content: '';
    position: absolute;
    left: -13px;
    /* Center perfectly with the 2px wide line at left: 4px */
    top: 10px;
    /* Centered with text */
    width: 8px;
    height: 8px;
    background-color: #fff;
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    z-index: 1;
}

.transit-step:first-child::before,
.transit-step:last-child::before {
    background-color: var(--accent-blue);
}

.transit-step.transfer {
    background: rgba(59, 130, 246, 0.05);
    /* Light blue background for transfer */
    margin: 4px 0 4px -4px;
    padding: 6px 8px;
    border-radius: 6px;
    border-left: 2px dashed var(--accent-blue);
}

.transfer-icon {
    min-width: 50px;
    color: var(--accent-blue);
    text-align: center;
    font-size: 1.1em;
}

.transfer-text {
    font-size: 0.85em;
    font-weight: bold;
    color: var(--accent-blue);
}

.train-text {
    font-weight: bold;
}

.transit-time {
    color: var(--text-muted);
    min-width: 50px;
    font-weight: 500;
}

.transit-station {
    color: var(--text-main);
    flex: 1;
}