:root {
  --ink: #0d111c;
  --ink-soft: #141a29;
  --panel: #192133;
  --panel-raised: #222c40;
  --line: #ffffff1c;
  --muted: #aeb8ca;
  --red: #d84b5c;
  --red-deep: #8b263e;
  --blue: #4e8fff;
  --blue-deep: #294da8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f7f7fb;
  background: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 9% 0%, #8f263d38 0, transparent 28%),
    radial-gradient(circle at 91% 0%, #2859bf38 0, transparent 30%),
    linear-gradient(135deg, var(--ink) 0%, #111826 52%, #0e1525 100%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { max-width: 1440px; margin: auto; padding: 0 28px; }
.site-header {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: relative;
  isolation: isolate;
}
.site-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--red) 0%, transparent 40%, transparent 60%, var(--blue) 100%);
  opacity: .8;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 15px; line-height: .94; letter-spacing: .11em; }
.brand-logo { display: block; width: 106px; height: 50px; object-fit: contain; filter: drop-shadow(-5px 0 12px #b12c4833) drop-shadow(5px 0 12px #3f7de83d); }
.header-right { display: flex; align-items: center; gap: 24px; }
.private-pill, .sync-status, .eyebrow { font-size: 11px; letter-spacing: .16em; font-weight: 800; }
.private-pill { color: #c8d6f4; border: 1px solid #7193d95c; border-radius: 999px; padding: 9px 12px; }
.sync-status { color: #b6c0d2; letter-spacing: .04em; }

.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  padding: 62px 2px 47px;
  position: relative;
  overflow: hidden;
}
.intro::after {
  content: "";
  position: absolute;
  right: 4%;
  top: 38px;
  width: 200px;
  height: 200px;
  border: 1px solid #ffffff12;
  border-radius: 50%;
  background: conic-gradient(from 215deg, #d84b5c1b 0 42%, transparent 42% 57%, #4e8fff1b 57% 100%);
  box-shadow: inset 0 0 0 22px #ffffff03;
  pointer-events: none;
}
.eyebrow { color: #df9ba2; margin: 0 0 15px; }
h1 { font-size: clamp(48px, 6.4vw, 92px); line-height: .98; letter-spacing: -.075em; margin: 0; font-weight: 900; position: relative; z-index: 1; }
h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #f07079 10%, #e4a0ac 44%, #8bb5ff 84%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle { color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 480px; margin: 22px 0 0; position: relative; z-index: 1; }
.intro-actions { display: flex; align-items: end; gap: 24px; flex-shrink: 0; position: relative; z-index: 1; }
.counter { display: flex; flex-direction: column; gap: 4px; border-left: 1px solid #ffffff30; padding-left: 22px; }
.counter strong { font-size: 36px; line-height: 1; }
.counter span { font-size: 10px; color: #aeb8ca; font-weight: 800; letter-spacing: .12em; }
.primary-button { border: 0; background: linear-gradient(110deg, #e06770, #c74662 48%, #4d7fe4); color: #fff; padding: 15px 21px; border-radius: 10px; font-weight: 850; box-shadow: 0 4px 0 #5e294a, 0 0 22px #d74d6429; transition: transform .15s, box-shadow .15s; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #5e294a, 0 0 30px #5184ed45; }
.primary-button:disabled { opacity: .5; cursor: wait; }

.board { display: grid; gap: 10px; }
.tier-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  min-height: 152px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(110deg, #1b2334, #151d2d);
  transition: background .2s, outline .2s;
}
.tier-row.drag-over { outline: 2px solid #dce8ff; outline-offset: -2px; background: #26344b; }
.tier-label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; color: #111725; background: var(--tier-color); position: relative; overflow: hidden; }
.tier-label::after { content: ""; position: absolute; inset: 0; background: linear-gradient(140deg, #ffffff4d, transparent 42%); pointer-events: none; }
.tier-letter { font-size: 48px; line-height: 1; font-weight: 950; letter-spacing: -.07em; position: relative; z-index: 1; }
.tier-subtitle { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; position: relative; z-index: 1; }
.tier-row[data-tier="U"] .tier-letter { font-size: 27px; letter-spacing: 0; }
.tier-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(78px, 9vw, 118px), 1fr));
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 152px;
  padding: 16px;
  overflow: visible;
}
.empty-message { color: #818da4; font-size: 13px; font-style: italic; padding: 4px 2px; align-self: center; }
.drink-card { display: flex; flex-direction: column; position: relative; width: 100%; min-width: 0; min-height: 119px; background: var(--panel-raised); border: 1px solid #ffffff20; border-radius: 9px; overflow: hidden; box-shadow: 0 4px 10px #00000020; }
.drink-card[draggable="true"] { cursor: grab; }
.drink-card.dragging { opacity: .4; }
.card-image { box-sizing: border-box; height: 84px; width: 100%; padding: 3px; object-fit: contain; background: radial-gradient(circle at 70% 20%, #5f8be83d 0, transparent 38%), linear-gradient(140deg, #302b3d, #263c67); }
.card-placeholder { height: 84px; width: 100%; display: grid; place-items: center; background: radial-gradient(circle at 70% 20%, #5f8be85e 0, transparent 36%), linear-gradient(140deg, #452737, #263c67); font-size: 35px; color: #e9dff0; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 2px; padding: 5px 6px; min-height: 35px; }
.card-name { font-size: 11px; font-weight: 750; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-edit { border: 0; background: transparent; color: #c2ccdf; font-size: 18px; line-height: 1; padding: 1px 3px; }
.card-edit:hover { color: #fff; }
.board-hint { color: #a5b0c3; font-size: 12px; text-align: center; margin: 21px 0 50px; }
.access-note { background: #26233a; border: 1px solid #697fc0; border-radius: 12px; padding: 24px; margin: 20px 0 80px; max-width: 600px; }
.access-note strong { color: #c1d3ff; }
.access-note p { color: #d1d8e6; line-height: 1.5; margin-bottom: 0; }
footer { border-top: 1px solid var(--line); padding: 28px 0 38px; color: #818da4; font-size: 12px; }

.drink-dialog { border: 1px solid #ffffff3b; border-radius: 17px; background: #1d2638; color: #fff; width: min(460px, calc(100vw - 24px)); padding: 27px; box-shadow: 0 22px 70px #0008; }
.drink-dialog::backdrop { background: #070a11d9; }
.dialog-top { display: flex; justify-content: space-between; align-items: start; }
.icon-button { border: 0; background: transparent; color: #d9e1f0; font-size: 30px; line-height: .7; }
.drink-form h2 { font-size: 30px; letter-spacing: -.05em; margin: 0 0 22px; }
.drink-form label { display: block; margin: 18px 0 8px; font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.optional { color: #aaaec1; text-transform: none; font-weight: 500; }
.drink-form input[type="text"], .drink-form select, .drink-form input[type="file"] { width: 100%; background: #29364d; border: 1px solid #7180a0; border-radius: 8px; padding: 12px; color: #fff; }
.drink-form input[type="file"] { font-size: 12px; }
.drink-form input::placeholder { color: #9fa9be; }
.input-help { font-size: 12px; color: #aaaec1; margin: 8px 0 0; }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 25px; }
.delete-button { border: 0; background: transparent; color: #ffaaa5; font-weight: 700; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: #e9efff; color: #172035; padding: 12px 18px; border-radius: 8px; box-shadow: 0 8px 30px #0008; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-size: 13px; font-weight: 700; max-width: calc(100vw - 30px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .app-shell { padding: 0 13px; }
  .site-header { height: 68px; }
  .brand { font-size: 12px; }
  .brand-logo { width: 78px; height: 38px; }
  .private-pill { display: none; }
  .intro { display: block; padding: 37px 3px 28px; }
  .intro::after { right: -62px; top: 25px; width: 170px; height: 170px; opacity: .75; }
  .subtitle { font-size: 14px; margin-top: 17px; }
  .intro-actions { justify-content: space-between; align-items: center; margin-top: 29px; }
  .counter strong { font-size: 28px; }
  .primary-button { padding: 13px 15px; }
  .tier-row { grid-template-columns: 57px minmax(0, 1fr); min-height: 124px; }
  .tier-content { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); min-height: 124px; padding: 8px; gap: 8px; }
  .tier-letter { font-size: 36px; }
  .tier-subtitle { font-size: 8px; line-height: 1.1; padding: 0 3px; }
  .tier-row[data-tier="U"] .tier-letter { font-size: 18px; }
  .drink-card { min-height: 104px; }
  .card-image, .card-placeholder { height: 68px; }
  .card-name { font-size: 10px; }
  .board-hint { line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
