@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
    color-scheme: light;
    --cream: #f5efe3;
    --paper: #fbf8f1;
    --ink: #263a2d;
    --muted: #73786a;
    --orange: #c76736;
    --gold: #d4a34f;
    --green: #526b48;
    --line: #e5dccb;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: 'DM Sans', sans-serif; }
.page-shell { width: min(1160px, calc(100% - 72px)); margin: 0 auto; }
.topbar { height: 96px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #c9a76a; border-radius: 50%; background: var(--paper); }
.brand-mark img { width: 27px; height: 27px; transition: transform .3s; }
.brand:hover .brand-mark img { transform: rotate(-8deg); }
.topbar-link { display: inline-flex; align-items: center; gap: 10px; padding: 5px 16px 5px 5px; border: 1px solid #c9a76a; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-decoration: none; box-shadow: 0 2px 10px rgb(199 103 54 / 8%); transition: background .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s; }
button.topbar-link { font-family: inherit; cursor: pointer; }
.topbar-link-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #f3e1c4; font-size: 15px; transition: transform .3s; }
.topbar-link-arrow { color: var(--orange); font-size: 14px; transition: transform .2s, color .2s; }
.topbar-link:hover, .topbar-link:focus-visible { border-color: var(--green); background: var(--green); color: #fffaf0; transform: translateY(-1px); box-shadow: 0 6px 16px rgb(82 107 72 / 22%); }
.topbar-link:hover .topbar-link-icon, .topbar-link:focus-visible .topbar-link-icon { transform: rotate(-12deg); }
.topbar-link:hover .topbar-link-arrow, .topbar-link:focus-visible .topbar-link-arrow { color: #fffaf0; transform: translateX(3px); }
.eyebrow { margin: 0 0 18px; color: var(--orange); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
h1, h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 500; }
h1 { margin: 0; font-size: clamp(48px, 6vw, 76px); line-height: 1.05; letter-spacing: -.045em; }
.submit-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; border: 0; border-radius: 4px; background: var(--green); color: #fffaf0; font-family: inherit; font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .2s, transform .2s; }
.submit-button:hover { transform: translateY(-1px); background: #40583a; }
.submit-button span { font-size: 15px; }
.countdown-section { margin: 48px 0; padding: 32px 20px 26px; border: 1px solid var(--line); border-radius: 8px; background: rgb(251 248 241 / 72%); text-align: center; }
.countdown-heading { display: flex; align-items: center; justify-content: center; gap: 20px; }
.countdown-date { margin-bottom: 10px; font-size: 26px; letter-spacing: .08em; }
.countdown-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.02em; }
.tiny-leaf { color: #b5a16e; font-size: 21px; }
.tiny-leaf-right { transform: rotate(70deg); }
.countdown { display: flex; justify-content: center; align-items: center; gap: clamp(13px, 4vw, 42px); margin: 27px auto 15px; }
.time-unit { display: grid; gap: 4px; min-width: 58px; }
.time-unit strong { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(30px, 5vw, 43px); font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.time-unit span { color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.time-separator { align-self: flex-start; padding-top: 5px; color: #c8b99d; font-family: 'Playfair Display', Georgia, serif; font-size: 28px; }
.footer { display: flex; align-items: center; justify-content: center; gap: 13px; min-height: 62px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.footer span:nth-child(2) { color: var(--orange); font-size: 13px; }

@media (max-width: 700px) {
    .page-shell { width: min(100% - 36px, 520px); }
    .topbar { height: 76px; }
    .topbar-link { gap: 7px; padding-right: 12px; font-size: 11px; }
    .topbar-link-icon { width: 26px; height: 26px; font-size: 13px; }
    h1 { font-size: clamp(48px, 12vw, 66px); }
    .countdown-section { margin: 30px 0; padding: 27px 10px 22px; }
    .countdown-heading { gap: 10px; }
    .countdown-heading h2 { font-size: 21px; }
    .countdown-date { font-size: 17px; }
    .countdown { gap: clamp(8px, 3vw, 20px); }
    .time-unit { min-width: 48px; }
    .footer { gap: 8px; font-size: 9px; }
    .dashboard-main { padding-top: 25px; }
    .welcome-panel { flex-direction: column; align-items: stretch; }
    .partner-panel { align-items: flex-start; gap: 13px; padding: 18px; }
    .mission-panel { align-items: flex-start; gap: 13px; padding: 18px; }
    .team-name-form { flex-direction: column; }
    .team-name-form .submit-button { width: 100%; }
    .mission-icon { flex-basis: 39px; width: 39px; height: 39px; font-size: 20px; }
    .partner-icon { flex-basis: 39px; width: 39px; height: 39px; font-size: 20px; }
    .chat-form { align-items: stretch; flex-direction: column; }
    .chat-form .submit-button { width: 100%; }
    .chat-refresh-note { text-align: left; }
    .waiting-panel { align-items: flex-start; padding: 20px; }
    .topbar:has(.space-tabs) { height: auto; flex-wrap: wrap; gap: 12px; padding: 14px 0; }
    .space-tabs { order: 3; width: 100%; }
    .space-tabs a { flex: 1; justify-content: center; padding: 8px 10px; font-size: 13px; }
}

.space-tabs { position: relative; display: flex; gap: 2px; padding: 5px; border: 1px solid #ddd0b6; border-radius: 40px; background: linear-gradient(180deg, #fbf8f1 0%, #f1e9da 100%); box-shadow: inset 0 1px 2px rgb(68 59 41 / 7%), 0 6px 18px rgb(68 59 41 / 5%); }
.space-tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 17px 8px 13px; border-radius: 40px; color: var(--muted); font-family: 'Playfair Display', Georgia, serif; font-size: 14px; font-style: italic; letter-spacing: -.01em; text-decoration: none; transition: background .25s, color .25s, box-shadow .25s; }
.space-tab-icon { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #d8c9ac; border-radius: 50%; background: #fffdf8; color: var(--orange); font-family: 'DM Sans', sans-serif; font-size: 12px; font-style: normal; transition: transform .35s, border-color .25s; }
.space-tabs a:hover { background: rgb(232 223 205 / 65%); color: var(--green); }
.space-tabs a:hover .space-tab-icon { transform: rotate(-18deg); }
.space-tabs a[aria-current="page"] { background: var(--green); color: #fffaf0; box-shadow: 0 4px 12px rgb(82 107 72 / 25%), inset 0 1px 0 rgb(255 255 255 / 12%); }
.space-tabs a[aria-current="page"] .space-tab-icon { border-color: rgb(255 250 240 / 35%); background: rgb(255 250 240 / 14%); color: var(--gold); }
.space-tabs a[aria-current="page"]::after { position: absolute; bottom: -9px; left: 50%; width: 5px; height: 5px; transform: translateX(-50%) rotate(45deg); background: var(--orange); content: ''; }
.space-tabs a:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.admin-main { min-height: calc(100vh - 160px); padding: 58px 0 64px; }
.admin-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.admin-heading .eyebrow { margin-bottom: 9px; }
.admin-heading h1 { font-size: clamp(38px, 7vw, 56px); }
.user-count { padding: 9px 13px; border: 1px solid var(--line); border-radius: 30px; background: var(--paper); color: var(--green); font-size: 11px; font-weight: 600; }
.user-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.user-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.user-table th, .user-table td { padding: 15px 18px; border-bottom: 1px solid var(--line); }
.user-table th { background: #f1ebdf; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.user-table tbody tr:last-child td { border-bottom: 0; }
.user-table td:first-child { font-weight: 600; }
.user-table a { color: var(--green); text-decoration: none; }
.user-table a:hover { text-decoration: underline; }
.empty-users { padding: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--muted); font-size: 13px; text-align: center; }
.team-draw-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 25px; padding: 24px; border: 1px solid #d9dfd0; border-radius: 7px; background: #eef1e8; }
.draw-card-copy { max-width: 550px; }
.draw-card-copy .eyebrow { margin-bottom: 7px; }
.draw-card-copy h2 { margin: 0; font-size: 27px; }
.draw-card-copy p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.registration-toggle-card.is-closed { border-color: #ead4bb; background: #fbf1e6; }
.registration-status { display: inline-block; margin-left: 8px; padding: 4px 9px; border-radius: 20px; background: #e8eee1; color: #435d3e; font-family: 'DM Sans', sans-serif; font-size: 10px; font-weight: 600; letter-spacing: .04em; vertical-align: middle; }
.is-closed .registration-status { background: #faeadb; color: #945527; }
.draw-button { width: auto; min-height: 42px; margin: 0; padding: 0 16px; }
.admin-badge { display: inline-block; padding: 5px 8px; border-radius: 20px; font-size: 9px; font-weight: 600; white-space: nowrap; }
.admin-badge { background: #eee8dd; color: #77654a; }
.dashboard-main { min-height: calc(100vh - 160px); padding: 42px 0 64px; }
.welcome-panel { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 25px; overflow: hidden; padding: clamp(27px, 5vw, 47px); border-radius: 8px; background: #e8dfcd; }
.welcome-panel .eyebrow { margin-bottom: 10px; }
.welcome-panel h1 { font-size: clamp(38px, 7vw, 58px); }
.welcome-panel > div:first-child > p:last-child { max-width: 540px; margin: 14px 0 0; color: #62695d; font-size: 13px; line-height: 1.75; }
.welcome-countdown { flex: 0 0 auto; padding: 16px 20px 14px; border: 1px solid rgb(201 167 106 / 45%); border-radius: 8px; background: rgb(251 248 241 / 62%); text-align: center; }
.welcome-countdown .eyebrow { margin-bottom: 8px; font-size: 9px; }
.welcome-countdown .countdown { gap: 6px; margin: 0; }
.welcome-countdown .time-unit { min-width: 38px; gap: 5px; }
.welcome-countdown .time-unit strong { font-size: 27px; }
.welcome-countdown .time-unit span { font-size: 8px; }
.welcome-countdown .time-separator { padding-top: 2px; font-size: 20px; }
.partner-panel { display: flex; align-items: center; gap: 20px; margin-top: 22px; padding: 23px 27px; border: 1px solid #d9dfd0; border-radius: 7px; background: #eef1e8; }
.partner-icon { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 50%; background: #dfe7d7; color: var(--green); font-size: 24px; }
.partner-panel .eyebrow { margin-bottom: 5px; }
.partner-panel h2 { margin: 0; color: var(--green); font-size: 24px; }
.partner-panel p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.mission-panel { display: flex; align-items: center; gap: 20px; margin-top: 16px; padding: 23px 27px; border: 1px solid #ead4bb; border-radius: 7px; background: #fbf1e6; }
.mission-icon { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 50%; background: #f5dfc6; font-size: 24px; }
.mission-panel .eyebrow { margin-bottom: 5px; }
.mission-panel h2 { margin: 0; color: #945527; font-size: 24px; }
.mission-panel p:not(.eyebrow) { margin: 7px 0 0; color: #775333; font-size: 11px; line-height: 1.6; }
.mission-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 11px; color: var(--orange); font-size: 11px; font-weight: 600; text-decoration: none; }
.mission-link:hover { text-decoration: underline; }
#mission { scroll-margin-top: 20px; }
.mission-panel > div { flex: 1; min-width: 0; }
.mission-panel.is-done { border-color: #d9dfd0; background: #eef1e8; }
.mission-panel.is-done .mission-icon { background: #dfe7d7; color: var(--green); font-size: 20px; font-weight: 700; }
.mission-panel.is-done h2 { color: var(--green); }
.team-name-form { display: flex; gap: 10px; margin-top: 14px; }
.team-name-form input { flex: 1; min-width: 0; min-height: 42px; padding: 10px 12px; border: 1px solid #dcd3c2; border-radius: 4px; outline: none; background: #fffdf8; color: var(--ink); font: inherit; font-size: 13px; }
.team-name-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(82 107 72 / 12%); }
.team-name-form .submit-button { width: auto; min-height: 42px; margin: 0; padding: 0 16px; }
.team-name-chip { display: inline-block; margin-top: 10px; padding: 5px 10px; border-radius: 20px; background: #fffaf0; color: var(--green); font-family: 'Playfair Display', Georgia, serif; font-size: 12px; font-style: italic; }
.chat-card { margin-top: 23px; padding: clamp(18px, 4vw, 30px); border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.chat-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.chat-heading .eyebrow { margin-bottom: 6px; }
.chat-heading h2 { margin: 0; font-size: clamp(21px, 4vw, 27px); }
.private-label { padding: 7px 10px; border-radius: 20px; background: #e8eee1; color: #435d3e; font-size: 9px; font-weight: 600; }
.chat-messages { display: flex; min-height: 230px; max-height: 430px; flex-direction: column; gap: 13px; overflow-y: auto; padding: 20px 4px; }
.chat-message { align-self: flex-start; max-width: min(82%, 560px); padding: 11px 14px; border: 1px solid #e7dfd0; border-radius: 4px 14px 14px 14px; background: #f6f1e8; }
.chat-message.is-mine { align-self: flex-end; border-color: #d9e1d1; border-radius: 14px 4px 14px 14px; background: #edf2e8; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--green); font-size: 10px; }
.message-meta time { color: #858577; font-size: 9px; }
.chat-message p { margin: 7px 0 0; color: #41483d; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-empty { display: grid; align-content: center; justify-items: center; flex: 1; color: var(--muted); text-align: center; }
.chat-empty span { font-size: 24px; }
.chat-empty p { max-width: 340px; font-family: 'Playfair Display', Georgia, serif; font-size: 14px; font-style: italic; line-height: 1.7; }
.chat-form { display: flex; align-items: end; gap: 12px; padding-top: 17px; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; min-height: 48px; max-height: 140px; resize: vertical; padding: 12px; border: 1px solid #dcd3c2; border-radius: 4px; outline: none; background: #fffdf8; color: var(--ink); font: inherit; font-size: 12px; }
.chat-form textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(82 107 72 / 12%); }
.chat-form .submit-button { width: auto; min-width: 104px; min-height: 48px; margin: 0; padding: 0 14px; }
.chat-refresh-note { margin: 12px 0 0; color: #888779; font-size: 9px; text-align: right; }
.chat-refresh-note[data-chat-offline="true"] { color: #945527; }
.waiting-panel { display: flex; align-items: center; gap: 20px; margin-top: 22px; padding: 27px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.waiting-panel > span { font-size: 31px; }
.waiting-panel h2 { margin: 0; font-size: 22px; }
.waiting-panel p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.registration-main { display: grid; min-height: calc(100vh - 160px); place-items: center; padding: 48px 0; }
.registration-card { position: relative; width: min(100%, 490px); padding: 42px clamp(22px, 6vw, 54px); border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 18px 55px rgb(68 59 41 / 6%); }
.registration-decoration { position: absolute; top: 29px; right: 31px; color: #c9aa73; font-size: 24px; }
.registration-card .eyebrow { margin-bottom: 10px; }
.registration-card h1 { font-size: clamp(34px, 7vw, 45px); }
.registration-intro { margin: 14px 0 25px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.registration-form { display: grid; }
.registration-form label { margin: 15px 0 7px; color: var(--ink); font-size: 11px; font-weight: 700; }
.registration-form input { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #dcd3c2; border-radius: 4px; outline: none; background: #fffdf8; color: var(--ink); font: inherit; font-size: 13px; }
.registration-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(82 107 72 / 12%); }
.field-hint { margin-top: 6px; color: var(--muted); font-size: 10px; }
.submit-button { width: 100%; min-height: 46px; margin-top: 26px; }
.form-message { margin: 18px 0; padding: 12px 14px; border-radius: 4px; font-size: 12px; line-height: 1.6; }
.form-message ul { margin: 0; padding-left: 18px; }
.form-success { border: 1px solid #c7d5bd; background: #eff5ea; color: #3e6037; }
.form-error { border: 1px solid #e3c6b5; background: #fbf0e9; color: #8b422d; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
