:root{
    --bg: #f7f7fb;
    --bg-accent: #eef2ff;
    --text: #2b2b2b;
    --muted: #8a8fa3;
    --brand: #e11d48; /* rose-600 */
    --brand-2: #2563eb; /* blue-600 */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --card-bg: #ffffff;
    --radius: 14px;
    --shadow: 0 10px 25px rgba(20,20,45,.08), 0 2px 8px rgba(20,20,45,.05);
}

* , *::before, *::after{ box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100%;
    color: var(--text);
    background:
        radial-gradient(1200px 500px at 120% -10%, #dbeafe 0%, rgba(219,234,254,0) 40%),
        radial-gradient(900px 400px at -10% 0%, #ffe4e6 0%, rgba(255,228,230,0) 38%),
        var(--bg);
    background-repeat: no-repeat;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    line-height: 1.6;
    letter-spacing: .2px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
a.linkBlack { color: #333; border-bottom: 1px dashed #888; }
a.linkBlack:hover { color: #000; border-bottom-color: #000; text-decoration: none; }

main {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

header{
    padding: 14px 18px 6px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(59,130,246,.09), rgba(244,63,94,.09));
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
header > div { margin: 18px 0 0 0; }
header div p { margin: 8px 0; }

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}
.brand h2 { margin: 0; }

h2 {
    font-weight: 700;
    line-height: 1.15;
    font-size: 34px;
    letter-spacing: .2px;
}
h2.jap{ color: #111827; opacity: .7; font-weight: 650; font-size: 24px; }
h2.second{ margin-top: 0; }
.jap{ font-family: "Hiragino Sans","Noto Sans JP","Yu Gothic UI","Yu Gothic","Meiryo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

.grad-text{ background: linear-gradient(135deg, #2563eb, #e11d48); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; }

.card{
    background: var(--card-bg); box-shadow: var(--shadow); border-radius: var(--radius);
    padding: 16px 16px 8px; margin: 28px 0; border: 1px solid rgba(59,130,246,.1);
}
.card.legal h1,
.card h3 { margin-top: 0; }
.full-bleed{
    width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
}
.big-img{ height: 280px; background-position: top center; background-size: cover; border-radius: 0; }
.big-img1{ background-image: url('/img/img_table1.jpg'); }
.big-img2{ background-image: url('/img/img_table2.jpg'); }
.big-img3{ background-image: url('/img/img_table3n.jpg'); }
.big-img4{ background-image: url('/img/img_okashi.jpg'); }

.badge{ display:inline-block; padding:6px 10px; border-radius:8px; font-size:14px; font-weight:600; }
.badgeToday{ background:#dbeafe; color:#1d4ed8; }
.badgeRunning{ background:#dcfce7; color:#16a34a; }
.badgeSoon{ background:#fef3c7; color:#b45309; }
.badgeRecent{ background:#f3f4f6; color:#374151; }

.grid-two{ display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid-two > * { min-width: 0; }
@media (min-width: 840px){ .grid-two{ grid-template-columns: 1fr 1fr; } }

.infoTable{ width: 100%; border-collapse: collapse; }
.infoTable tr td{ border-bottom: 1px dotted #e5e7eb; padding: 10px 6px; }
.infoTable tr:last-child td{ border-bottom: none; }
.infoTable tr td:first-child{ width: 32%; color:#475569; }

/* Mini calendar styles */
.cal-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 10px 0 18px; }
.cal { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.cal .cal-head { background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(225,29,72,.12)); padding: 8px 12px; font-weight: 700; text-align: center; }
.cal .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal .dow { font-size: 12px; text-align: center; padding: 6px 4px; color: #6b7280; background: #f9fafb; border-bottom: 1px solid #f1f5f9; }
.cal .empty { background: #fafafa; height: 34px; border-bottom: 1px solid #f1f5f9; }
.cal .day { position: relative; height: 34px; padding: 6px 8px; border-bottom: 1px solid #f1f5f9; border-right: 1px solid #f8fafc; font-size: 13px; }
.cal .day:nth-child(7n) { border-right: none; }
.cal .day .num { position: absolute; top: 6px; right: 8px; font-weight: 600; color: #374151; }
.cal .day.today { background: #eff6ff; outline: 2px solid #bfdbfe; }
.cal .day.event-available { background: #ecfdf5; outline: 2px solid #a7f3d0; }
.cal .day.event-booked { background: #fff1f2; outline: 2px solid #fecaca; }
/* Today + event: keep event color but add strong green border */
.cal .day.today.event-available,
.cal .day.today.event-booked {
  outline: none; /* override event outline */
  box-shadow: 0 0 0 3px var(--success) inset;
  border-radius: 4px;
}
.cal .dot { position: absolute; left: 8px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; }
.cal .dot.available { background: #22c55e; }
.cal .dot.booked { background: #ef4444; }
.cal-legend { display: flex; gap: 14px; justify-content: center; font-size: 13px; color: #4b5563; margin-top: 8px; }
.cal-legend .i { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .b { width: 12px; height: 12px; display: inline-block; border: 2px solid transparent; }
.cal-legend .b.av { background: #ecfdf5; border-color: #a7f3d0; }
.cal-legend .b.bo { background: #fff1f2; border-color: #fecaca; }

@media (min-width: 900px){
    .big-img{ height: 380px; }
}

footer { text-align: center; font-size: 0.9rem; margin-top: 26px; }
footer, footer a { color: var(--muted); }
footer a { margin: 0 12px; }
footer a.active, footer a[aria-current="page"] { color: var(--brand-2); font-weight: 700; text-decoration: none; }
hr { border: none; border-bottom: 1px solid #e5e7eb; margin: 24px 0; }

/* Legal pages: Impressum & Datenschutz */
.legal { color: #6b7280; font-size: 0.9rem; line-height: 1.5; }
.legal p, .legal li { color: #6b7280; }
.legal p { margin: 6px 0; }

/* Interactions */
a:focus-visible, .btn:focus-visible, .cal .day:focus-visible{ outline: 3px solid #2563eb; outline-offset: 2px; border-radius: 6px; }

@keyframes fadeUp{
    from{ opacity: 0; transform: translate3d(0, 6px, 0); }
    to{ opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* Dark mode */
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b0f19; --bg-accent:#0b1224; --text:#e5e7eb; --muted:#9aa2b2;
    --card-bg:#0f1629; --shadow: none;
  }
  body{ background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(225,29,72,.08)), var(--bg); background-repeat: no-repeat; }
  header{ background: linear-gradient(135deg, rgba(37,99,235,.14), rgba(225,29,72,.14)); }
  .cal .dow{ background:#0f1524; }
  .cal{ border-color:#1f2937; }
}

/* Subtle highlight for jump */
#next-event.flash{ box-shadow: 0 0 0 3px rgba(37,99,235,.35) inset; }

/* Responsive tweaks */
@media (max-width: 640px){
    h2{ font-size: 28px; }
    h2.jap{ font-size: 22px; }
    h3{ font-size: 20px; }
    .big-img{ height: 220px; }
    table.infoTable tr td:first-child{ width: 36%; }
}

/* Utilities moved from inline styles to keep CSS in main.css only */
.text-center { text-align: center; }
.pad-h-42 { padding-left: 42px; padding-right: 42px; }
.pad-b-32 { padding-bottom: 32px; }
.mt-4 { margin-top: 4px; }
.vam-middle { vertical-align: middle; }
.notice-booked { text-align: center; background-color: #fddada; display: inline-block; padding: 8px 16px; border-radius: 6px; }
.logo { width: 88px; height: 88px; }
.lead-block { font-size: 18px; line-height: 1.4em; }


/* iOS visual viewport fix: prefer dynamic viewport units to avoid initial overflow on iPhone */
@supports (width: 100dvw){
  .full-bleed{
    width: 100dvw;
    margin-left: calc(50% - 50dvw);
    margin-right: calc(50% - 50dvw);
  }
}

/* Prevent media from causing horizontal overflow */
img, video, svg { max-width: 100%; height: auto; }

/* Prefer small viewport on initial paint to avoid iOS first-load overspill */
@supports (width: 100svw){
  .full-bleed{
    width: 100svw;
    margin-left: calc(50% - 50svw);
    margin-right: calc(50% - 50svw);
  }
}


/* Buttons */
.btn{ appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; font-weight: 600; border-radius: 10px; border: 1px solid transparent; cursor: pointer; background: #eef2ff; color: #1f2937; box-shadow: var(--shadow); transition: box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease; }
/* No positional transform on hover to avoid visual jump */
.btn:hover{ box-shadow: 0 12px 28px rgba(20,20,45,.12), 0 4px 12px rgba(20,20,45,.06); }
.btn:active{ box-shadow: none; }
.btn-primary{ background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; border-color: rgba(37,99,235,.6); }
.btn-primary:hover{ filter: brightness(1.05); }
.btn-danger{ background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; border-color: rgba(239,68,68,.6); }
.btn-danger:hover{ filter: brightness(1.05); }
.btn:disabled{ opacity: .6; cursor: not-allowed; transform: none; }

@media (prefers-color-scheme: dark){
  .btn{ background: #111827; color: #e5e7eb; border-color: #1f2937; box-shadow: none; }
  .btn-primary{ background: linear-gradient(135deg, #1d4ed8, #1e40af); border-color: #1e3a8a; }
  .btn-danger{ background: linear-gradient(135deg, #dc2626, #b91c1c); border-color: #991b1b; }
}


/* Form controls */
.form-label{ display:inline-block; font-weight:600; color:#374151; margin-bottom:6px; }
.input{ width:100%; padding:10px 12px; border:1px solid #e5e7eb; border-radius:10px; background:#f9fafb; color:var(--text); line-height:1.4; box-shadow: inset 0 1px 2px rgba(0,0,0,.03); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.input::placeholder{ color:#9ca3af; }
.input:hover{ border-color:#d1d5db; }
.input:focus{ outline:none; border-color:#2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.18); background:#fff; }
.input:disabled{ background:#f3f4f6; color:#9ca3af; cursor:not-allowed; }

@media (prefers-color-scheme: dark){
  .form-label{ color:#cbd5e1; }
  .input{ background:#0f1524; border-color:#1f2937; color:#e5e7eb; box-shadow:none; }
  .input:hover{ border-color:#334155; }
  .input:focus{ border-color:#60a5fa; box-shadow: 0 0 0 3px rgba(59,130,246,.22); background:#0b1224; }
  .input:disabled{ background:#0b1224; color:#64748b; }
}




@media (prefers-color-scheme: dark){
  /* Header Japanese title contrast in dark mode */
  /* Override the light-theme heading color to ensure readability on dark background */
  header .jap, h2.jap { color: #e5e7eb; opacity: .95; }
}


@media (prefers-color-scheme: dark){
  /* Dark mode calendar polish: ensure proper contrast and tidy borders on homepage mini calendar */
  .cal{ background: var(--card-bg); border-color:#1f2937; }
  .cal .cal-head{ background: linear-gradient(135deg, rgba(37,99,235,.18), rgba(225,29,72,.18)); color:#e5e7eb; }
  .cal .dow{ background:#0f1524; color:#9aa2b2; border-bottom:1px solid #1f2937; }
  .cal .empty{ background:#0b1224; border-bottom:1px solid #1f2937; }
  .cal .day{ background: transparent; border-bottom:1px solid #1f2937; border-right:1px solid #111827; }
  .cal .day:nth-child(7n){ border-right: none; }
  .cal .day .num{ color:#cbd5e1; }
  /* State colors tuned for dark */
  .cal .day.today{ background: rgba(37,99,235,0.10); outline: 2px solid #60a5fa; }
  .cal .day.event-available{ background: rgba(16,185,129,0.10); outline: 2px solid #059669; }
  .cal .day.event-booked{ background: rgba(239,68,68,0.10); outline: 2px solid #b91c1c; }
  /* When today overlaps an event, keep a clear inner glow */
  .cal .day.today.event-available,
  .cal .day.today.event-booked{ outline: none; box-shadow: 0 0 0 3px #22c55e inset; border-radius: 4px; }
  /* Legend adjustments */
  .cal-legend{ color:#9aa2b2; }
  .cal-legend .b.av{ background: rgba(16,185,129,0.15); border-color:#059669; }
  .cal-legend .b.bo{ background: rgba(239,68,68,0.15); border-color:#b91c1c; }
}

@media (prefers-color-scheme: dark){
  /* Dark mode: make special black-styled links readable on dark background */
  a.linkBlack { color: #dbeafe; border-bottom: 1px dashed #9aa2b2; }
  a.linkBlack:hover { color: #ffffff; border-bottom-color: #ffffff; text-decoration: none; }
}

@media (prefers-color-scheme: dark){
  /* Admin: make the date input's calendar icon visible in dark mode */
  /* Works in Chromium/Edge/Safari (WebKit/Blink) and hints Firefox via color-scheme */
  .input[type="date"]{ color-scheme: dark; }
  .input[type="date"]::-webkit-calendar-picker-indicator{ filter: invert(1) brightness(1.6) contrast(1.15); opacity: .95; }
  .input[type="date"]::-webkit-calendar-picker-indicator:hover{ opacity: 1; }
  /* Also lighten auxiliary buttons some engines render */
  .input[type="date"]::-webkit-inner-spin-button,
  .input[type="date"]::-webkit-clear-button{ filter: invert(1) brightness(1.2); }
}
