:root {
    /* tas.coffee inspired palette */
    --deep-bg: #111111;
    --deep-navy: #12202E;
    --off-white: #F5F5F3;
    --concrete: #8A8A8A;
    --accent: #D4A373; /* Subtle brass/wood accent */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--deep-bg);
    color: var(--off-white);
    font-family: var(--font-sans);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    margin: 0 auto;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--deep-bg) 0%, var(--deep-navy) 100%);
    position: relative;
}

header {
    text-align: left;
    margin-bottom: 40px;
}

header h1 {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--concrete);
    margin: 0;
    font-weight: 300;
}

#refresh-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--off-white);
    opacity: 0.3;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    z-index: 100;
}

#refresh-btn:active {
    opacity: 0.8;
}

#refresh-btn.refreshing svg {
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo {
    font-size: 1.8rem;
    filter: grayscale(1);
    opacity: 0.8;
}

#app-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox hide scrollbar */
}
#app-view::-webkit-scrollbar {
    display: none; /* Chrome/Safari hide scrollbar */
}

/* ── Today View ── */
.today-date {
    font-family: 'Marcellus', serif;
    font-size: 1.1rem;
    color: var(--off-white);
    margin-bottom: 5px;
    letter-spacing: 0.05em;
    font-weight: 300;
}

.status-content {
    text-align: left;
    animation: fadeIn 1s ease-out;
}

.status-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.status-label {
    font-size: 4.5rem;
    font-weight: 200;
    letter-spacing: -0.02em;
    margin-bottom: 15px;
    line-height: 1;
}

.status-message {
    font-size: 1rem;
    color: var(--concrete);
    line-height: 1.6;
    max-width: 300px;
    font-weight: 300;
}

/* ── Social / Shop Links ── */
.social-links {
    margin-top: 40px;
    display: flex;
    gap: 20px;
    animation: fadeIn 1.2s ease-out;
}

.social-links a {
    color: var(--concrete);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 2px;
    transition: all 0.3s;
}

.social-links a:hover {
    color: var(--off-white);
    border-color: var(--off-white);
}

/* ── Event Box ── */
.event-info-box {
    margin-top: 48px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.event-badge {
    display: inline-block;
    font-size: 0.6rem;
    color: var(--concrete);
    border: 1px solid var(--concrete);
    padding: 2px 8px;
    margin-bottom: 12px;
    letter-spacing: 0.1em;
}

.event-name {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 12px;
}

.event-link {
    font-size: 0.8rem;
    color: var(--off-white);
    text-decoration: none;
    border-bottom: 1px solid var(--concrete);
}

/* ── Calendar View ── */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.calendar-header h2 {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--off-white);
}

.calendar-header button {
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--concrete);
}

.calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    width: 100%;
}

.cal-label {
    text-align: center;
    font-size: 0.6rem;
    color: var(--concrete);
    padding-bottom: 10px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.cal-day.today {
    border: 2px solid var(--off-white);
    background: rgba(255, 255, 255, 0.05);
}

/* Number Container */
.cal-day span {
    position: relative;
    z-index: 2;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* 休み：一本の斜線 (丸と同じ色) */
.has-status-closed::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 2px;
    background: var(--off-white);
    opacity: 0.6; /* 少し透過させて馴染ませる */
    transform: rotate(-45deg);
    z-index: 1;
    pointer-events: none;
}
.has-status-closed {
    opacity: 0.6;
}
.has-status-closed.has-event-info {
    opacity: 1; /* イベントがある場合は透過させない */
}

/* 営業日：丸 */
.has-status-open span, 
.has-status-busy span,
.has-status-after-event span {
    border: 1px solid var(--off-white);
}

/* イベント：四角 */
.has-status-event span,
.has-status-event-away span,
.has-event-info span {
    border: 1px solid var(--accent);
    border-radius: 0 !important;
}

/* イベント出店：四角 + 斜線 */
.has-status-event-away::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 2px;
    background: var(--off-white);
    opacity: 0.6;
    transform: rotate(-45deg);
    z-index: 1;
    pointer-events: none;
}
.has-status-event-away {
    opacity: 0.7;
}

/* 分割スケジュール：ツートングラデーションの丸（スプリット表現） */
.has-status-split span {
    border: 1px solid var(--off-white);
    background: linear-gradient(135deg, transparent 50%, rgba(212, 163, 115, 0.6) 50%);
}

.cal-day.selected {
    background: var(--off-white) !important;
    color: var(--deep-bg) !important;
    border-color: var(--off-white);
}

.cal-day.selected span {
    border-color: transparent !important;
}

.cal-day .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    margin-top: 4px;
    display: none; /* Hide dots in favor of shapes */
}

/* ── Day Details ── */
.day-details {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.details-date {
    font-size: 0.75rem;
    color: var(--concrete);
    margin-bottom: 10px;
}

.details-status {
    font-size: 1.2rem;
    font-weight: 200;
}

/* ── Footer / Nav ── */
footer {
    text-align: center;
    padding-bottom: 20px;
}

.nav-bar {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px;
    border-radius: 2px;
    margin-bottom: 20px;
}

.nav-bar button {
    background: none;
    border: none;
    padding: 8px 20px;
    font-size: 0.75rem;
    color: var(--concrete);
    cursor: pointer;
}

.nav-bar button.active {
    background: var(--off-white);
    color: var(--deep-bg);
}

#updated-at {
    font-size: 0.6rem;
    color: var(--concrete);
    letter-spacing: 0.1em;
}

@keyframes fadeIn {
    from { opacity: 0; filter: blur(5px); }
    to { opacity: 1; filter: blur(0); }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid var(--off-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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