:root {
    /* Color Palette */
    --primary-color: #13295A;
    /* 明治学園ネイビー */
    --primary-dark: #0B1A3A;
    --accent-color: #FF9F1C;
    /* 活気のあるオレンジ */
    --accent-light: #FFBF69;
    --text-color: #333333;
    --text-light: #666666;
    --background-color: #FAFAFA;
    --white: #FFFFFF;
    --border-color: #E0E0E0;
    --success-color: #2ECC71;
    --warning-color: #F1C40F;
    --danger-color: #E74C3C;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font-family-base: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 14px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: var(--font-size-base);
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
}

a:hover {
    opacity: 0.8;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

/* Header */
.site-header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--spacing-sm) 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: var(--font-size-lg);
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.site-logo span {
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

/* Navigation */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 101;
}

.nav-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background-color: var(--white);
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    padding: 80px 0;
    /* Removed horizontal padding to let link fill width */
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 102;
    /* Ensure it's above overlay and toggle */
}

.nav-menu.active {
    right: 0;
}

.nav-menu ul {
    width: 100%;
}

.nav-menu li {
    margin-bottom: 0;
    /* Remove margin/padding from li */
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}

.nav-menu a {
    font-size: var(--font-size-lg);
    font-weight: bold;
    color: var(--text-color);
    display: block;
    padding: var(--spacing-md) var(--spacing-lg);
    /* Add padding to a tag */
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    /* Changed from semi-transparent black */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Hamburger Animation */
/* User requested to remove the "X" button when active */
.nav-toggle.active {
    opacity: 0;
    pointer-events: none;
}

/* 
.nav-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
} 
*/

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-weight: bold;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 6px rgba(44, 180, 230, 0.3);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--white);
    box-shadow: 0 4px 6px rgba(255, 159, 28, 0.3);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* Sections */
section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.card-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--primary-dark);
}

/* Footer */
.site-footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.footer-links {
    margin-bottom: var(--spacing-lg);
}

.footer-links a {
    display: inline-block;
    margin: 0 var(--spacing-sm);
    color: rgba(255, 255, 255, 0.8);
}

/* Responsive PC */
@media (min-width: 768px) {
    /* 
       以前はここでナビゲーションをリスト表示に切り替えていましたが、
       ハンバーガーメニュー統一のため削除しました。
    */

    /*
    .nav-toggle {
        display: none;
    }

    .nav-menu {
        position: static;
        width: auto;
        height: auto;
        background: none;
        box-shadow: none;
        padding: 0;
        display: flex;
        overflow: visible;
    }

    .nav-menu li {
        margin: 0 0 0 var(--spacing-lg);
        border: none;
        padding: 0;
    }

    .nav-menu a {
        font-size: var(--font-size-base);
        font-weight: normal;
    }
    */

    /* ドロワーメニューがPCで広がりすぎないように制限 */
    .nav-menu {
        width: 400px;
        right: -400px;
        /* 初期位置も幅に合わせる */
    }

    .btn-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Home Page specific styles */
.hero {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    transition: background-color 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.hero-nav:hover {
    background: rgba(255, 255, 255, 0.4);
}

.hero-nav.prev {
    left: var(--spacing-md);
}

.hero-nav.next {
    right: var(--spacing-md);
}

.hero-subtitle {
    font-size: var(--font-size-sm);
    letter-spacing: 0.1em;
    opacity: 0.9;
    margin-bottom: var(--spacing-sm);
}

.hero-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.05em;
}

.hero-date {
    font-size: var(--font-size-lg);
    font-weight: 500;
}

.hero-date span {
    font-size: var(--font-size-sm);
    margin-left: 2px;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm); /* スマホで隙間が広すぎないよう少し狭める */
}

.nav-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    aspect-ratio: 1 / 0.8;
}

.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.nav-card i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.nav-card span {
    font-weight: bold;
    color: var(--text-color);
    font-size: var(--font-size-base);
    line-height: 1.3;
}

.news-list {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.news-item {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
    border-bottom: none;
}

.news-date {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-bottom: 2px;
}

/* Responsive specific for home */
@media (max-width: 768px) {
    /* 3列を画面内に収めるための微調整（主にタブレット・中画面スマホ向け） */
    .nav-grid {
        gap: 8px; /* 隙間を最小限に */
    }

    .nav-card {
        padding: 12px 4px; /* カード内の余白を大幅に減らす */
        border-radius: var(--radius-md); /* 角丸を少し控えめに */
    }

    .nav-card i {
        font-size: 24px; /* アイコンを小さく */
        margin-bottom: 4px;
    }

    .nav-card span {
        font-size: 11px; /* 文字を小さく */
        letter-spacing: -0.02em; /* 文字間を少し詰めて収まりやすく */
        line-height: 1.2;
    }

    .news-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-date {
        margin-bottom: 2px;
    }
}

/* スマホ向け：2列表示に切り替え（より自然なレイアウト） */
@media (max-width: 600px) {
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .nav-card {
        padding: 16px 8px;
        aspect-ratio: auto;
        min-height: 110px;
    }
    
    .nav-card span {
        font-size: 13px; /* 2列なら文字を少し大きくできる */
        letter-spacing: normal;
    }
}

@media (min-width: 769px) {
    /* PC・タブレット用のゆったりした設定 */
    .news-item {
        flex-direction: row;
        align-items: center;
    }

    .news-date {
        margin-bottom: 0;
        margin-right: var(--spacing-md);
        min-width: 100px;
    }
}

/* --- Map Page --- */
/* --- Map Page --- */
.map-tabs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.map-tab-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
}

.map-tab-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(19, 41, 90, 0.2);
}

.map-viewer-wrapper {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    /* Contains the zoomed image */
    height: 500px;
    /* Fixed height for viewport */
    border: 1px solid var(--border-color);
}

.map-viewer-wrapper:fullscreen {
    height: 100vh;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
    background: var(--background-color);
}

.map-viewer-wrapper:-webkit-full-screen {
    height: 100vh;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
    background: var(--background-color);
}

.map-content {
    display: none;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Enable scrolling for panning */
    cursor: grab;
}

.map-content.active {
    display: block;
}

.map-content.panning {
    cursor: grabbing;
}

.zoom-container {
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease-out;
    transform-origin: center center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.main-map-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-select: none;
}

/* Map Controls */
.map-controls {
    position: absolute;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    z-index: 100;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background 0.2s;
}

.control-btn:hover {
    background: #f0f0f0;
}

.map-container {
    /* Generic container for other elements if needed */
    padding: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
}

.map-visual {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto var(--spacing-md);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.main-map-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

/* Marker Buttons */
.map-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    z-index: 10;
}

.map-marker:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translate(-50%, -60%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: var(--font-size-sm);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 4px;
}

/* --- Events (Projects) Page --- */
.category-filter {
    display: flex;
    overflow-x: auto;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.category-filter::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.filter-btn {
    white-space: nowrap;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-light);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.event-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.event-image {
    width: 100%;
    height: 150px;
    background-color: #eee;
    object-fit: cover;
}

.event-content {
    padding: var(--spacing-md);
}

.event-category {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.event-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background-color: #f0f0f0;
    color: #666;
    margin-top: 4px;
}

/* --- Food Page --- */
.food-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.food-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.food-info h3 {
    font-size: var(--font-size-base);
    margin-bottom: 4px;
}

.food-price {
    font-weight: bold;
    color: var(--accent-color);
}

.food-location {
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

/* --- Family Page --- */
.family-hero {
    background-color: #FFF3E0;
    /* Light orange */
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    border: 2px solid var(--accent-light);
}

.family-title {
    color: var(--accent-color);
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-sm);
}

.kids-stamp-card {
    background: url('data:image/svg+xml;utf8,<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="2" fill="%23eee"/></svg>') repeat;
    padding: var(--spacing-lg);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-lg);
    text-align: center;
}

/* --- Guidelines Page --- */
.guideline-section {
    margin-bottom: var(--spacing-xl);
}

.guideline-item {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    background: #fff;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

.guideline-icon {
    font-size: 24px;
    color: var(--warning-color);
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.guideline-text h3 {
    font-size: var(--font-size-base);
    margin-bottom: 4px;
}

.guideline-text p {
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

/* Timetable-specific helpers */
.tab-container {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.tab-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-bottom: 2px solid transparent;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.filter-section {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    background: #f0f8ff;
    padding: var(--spacing-sm);
    border-radius: var(--radius-full);
}

.radio-label {
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.schedule-item {
    background: var(--white);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.schedule-item:hover {
    transform: translateX(4px);
}

.schedule-time {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    font-family: monospace;
}

.schedule-title {
    font-size: var(--font-size-lg);
    margin: 4px 0;
}

.schedule-venue {
    font-size: var(--font-size-sm);
    color: var(--primary-dark);
}

/* Timetable Card Layout */
.timetable-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.timetable-view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.timetable-view.active {
    display: block;
}

.location-section {
    margin-bottom: var(--spacing-xl);
}

.location-title {
    background-color: var(--primary-color);
    color: var(--white);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-lg);
    font-weight: bold;
    display: inline-block;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sub-location-title {
    font-size: var(--font-size-base);
    font-weight: bold;
    color: var(--primary-dark);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    padding-bottom: 4px;
    border-bottom: 2px solid #ddd;
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.event-card-box {
    background: var(--white);
    border-left: 5px solid var(--accent-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.event-card-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.event-time {
    font-family: monospace;
    color: var(--text-light);
    font-size: var(--font-size-sm);
    margin-bottom: 4px;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
}

.event-name {
    font-size: var(--font-size-lg);
    font-weight: bold;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.event-location-tag {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: bold;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

/* Color coding by location type */
.loc-gym .location-title {
    background-color: #2CB4E6;
}

/* Light Blue */
.loc-audit .location-title {
    background-color: #FF9F1C;
}

/* Orange */
.loc-court .location-title {
    background-color: #2ECC71;
}

/* Green */

.loc-gym .event-card-box {
    border-left-color: #2CB4E6;
}

.loc-audit .event-card-box {
    border-left-color: #FF9F1C;
}

.loc-court .event-card-box {
    border-left-color: #2ECC71;
}

@media (min-width: 768px) {
    .timetable-columns {
        display: flex;
        align-items: flex-start;
        gap: var(--spacing-lg);
        overflow-x: auto;
        padding-bottom: var(--spacing-lg);
    }

    .timetable-column {
        flex: 1;
        min-width: 250px;
        background: #f9f9f9;
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .timetable-column .location-title {
        width: 100%;
        text-align: center;
    }

    .event-grid {
        grid-template-columns: 1fr;
        /* Stack in column */
    }
}

/* --- Realtime Banner and Badges --- */
#realtime-widget-container {
    margin-bottom: var(--spacing-lg);
}

.realtime-banner {
    background: #fff3e0;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: 0 4px 12px rgba(255, 159, 28, 0.15);
}

.realtime-banner-live {
    background: #fff0f0;
    border: 2px solid var(--danger-color);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.15);
}

.realtime-banner-live .realtime-title {
    color: var(--danger-color);
}

.realtime-banner-live .realtime-item {
    border-left-color: var(--danger-color);
}

.realtime-title {
    font-size: var(--font-size-lg);
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

.realtime-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.realtime-item {
    background: #fff;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 4px solid var(--accent-color);
    font-weight: bold;
}

.realtime-item .loc {
    color: var(--primary-color);
    font-size: var(--font-size-sm);
}

.realtime-more {
    font-size: var(--font-size-sm);
    color: var(--primary-color);
    text-align: right;
    display: block;
    margin-top: 4px;
    font-weight: bold;
}

.realtime-badge-container {
    margin-bottom: var(--spacing-sm);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}

.badge-live {
    background-color: var(--danger-color);
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
    animation: pulseBadge 2s infinite;
}

.badge-soon {
    background-color: var(--warning-color);
    color: #333;
    animation: none;
}

@keyframes pulseBadge {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Timetable Real-Time Highlighting --- */
.event-card-box.live-now {
    border: 3px solid var(--danger-color);
    background-color: #fff0f0;
    position: relative;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

.event-card-box.soon-now {
    border: 3px solid var(--warning-color);
    background-color: #fffdf0;
    position: relative;
}

.tt-badge-container {
    margin-bottom: 4px;
}

.tt-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: bold;
    color: #fff;
}

.tt-badge.badge-live {
    background-color: var(--danger-color);
    animation: pulseBadge 2s infinite;
}

.tt-badge.badge-soon {
    background-color: var(--warning-color);
    color: #333;
    animation: none;
}

/* =========================================
   STAMP RALLY STYLES
   ========================================= */

.stamp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.stamp-item {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 1rem 0.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stamp-item.acquired {
    background: #fff8e1;
    border-color: #ffc107;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
}

.stamp-item.locked {
    opacity: 0.6;
    filter: grayscale(100%);
}

.stamp-icon {
    margin-bottom: 0.5rem;
}

.stamp-name {
    font-weight: bold;
    font-size: 0.9rem;
    margin: 0.5rem 0 0.2rem;
    color: #333;
}

.stamp-status {
    font-size: 1.2rem;
    font-weight: bold;
}

.stamp-item.acquired .stamp-status {
    color: #FF5722;
}

.stamp-item.locked .stamp-status {
    color: #999;
}

@keyframes stampPopUp {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@media (max-width: 600px) {
    .stamp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 340px) {
    .stamp-grid {
        grid-template-columns: 1fr;
    }
}