:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #f7f1d7;
  --muted: #c9c1a6;
  --paper: #2b2b2b;
  --panel: #323232;
  --card: #1f1f1f;
  --card-deep: #171717;
  --line: #5a5133;
  --yellow: #ffe600;
  --gold: #f2d339;
  --red: #ff4d35;
  --blue: #ffe600;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--yellow);
  color: #161616;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: .55;
  cursor: wait;
}

.shell {
  width: min(720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 26px;
}

.login-brand {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.login-brand p {
  margin: 0;
  color: #595959;
  font-size: 15px;
  font-weight: 700;
}

.login-mark {
  width: 74px;
  height: 74px;
  overflow: visible;
  filter:
    drop-shadow(0 0 8px rgba(255, 230, 0, .30))
    drop-shadow(0 0 18px rgba(255, 230, 0, .16));
}

.login-view h1 {
  margin: 0;
  font-size: clamp(42px, 12vw, 72px);
  line-height: .95;
}

.login-panel {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 2px solid rgba(255, 230, 0, .45);
  border-radius: 8px;
  padding: 13px;
  background: var(--card);
  color: var(--ink);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--gold);
}

.message {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px 12px;
  border-bottom: 18px solid rgba(255, 230, 0, .92);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 46px;
  min-width: 46px;
  height: 46px;
  overflow: visible;
  filter:
    drop-shadow(0 0 7px rgba(255, 230, 0, .34))
    drop-shadow(0 0 15px rgba(255, 230, 0, .18));
}

.mark-tag,
.mark-fold,
.mark-hole,
.mark-y {
  fill: none;
  stroke: var(--yellow);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mark-tag {
  stroke-width: 3.4;
}

.mark-fold,
.mark-y {
  stroke-width: 3;
}

.mark-hole {
  stroke-width: 2.6;
  opacity: .9;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 8vw, 42px);
  line-height: .95;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.icon-button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--yellow);
  font-size: 26px;
  line-height: 1;
}

.status-banner {
  min-height: 30px;
  padding: 7px 14px;
  background: rgba(255, 230, 0, .12);
  color: var(--gold);
  font-weight: 700;
  text-align: center;
}

.status-banner:empty {
  display: none;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px 0;
}

.tab-button {
  min-height: 42px;
  border: 1px solid rgba(255, 230, 0, .35);
  background: var(--card);
  color: var(--muted);
  box-shadow: none;
}

.tab-button.active {
  background: rgba(255, 230, 0, .14);
  color: var(--ink);
  border-color: rgba(255, 230, 0, .72);
  box-shadow: 0 0 14px rgba(255, 230, 0, .16);
}

.board-section {
  padding: 14px 14px 18px;
}

.send-section {
  padding-bottom: 14px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1;
}

.text-link {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.send-card-cell {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.card-history-link {
  min-height: 0;
  padding: 0 2px;
  border-radius: 0;
  background: transparent;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.view-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.view-mode-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--yellow);
}

.yellow-card {
  aspect-ratio: 1 / 1.18;
  width: 100%;
  border: 2px solid var(--yellow);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--card), var(--card-deep));
  color: var(--ink);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  box-shadow:
    0 0 0 1px rgba(255, 230, 0, .22),
    0 0 18px rgba(255, 230, 0, .34),
    0 14px 28px rgba(0, 0, 0, .38);
  padding: 12px 8px;
}

.yellow-card span {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: clamp(23px, 7vw, 34px);
  line-height: 1;
}

.yellow-card strong {
  color: var(--yellow);
  text-shadow: 0 0 16px rgba(255, 230, 0, .42);
  font-size: clamp(44px, 14vw, 72px);
  line-height: .9;
}

.dialog {
  width: min(520px, calc(100% - 28px));
  border: 1px solid rgba(255, 230, 0, .5);
  border-radius: 14px;
  padding: 20px;
  color: var(--ink);
  background: var(--panel);
  box-shadow:
    0 0 24px rgba(255, 230, 0, .22),
    0 22px 60px rgba(0, 0, 0, .46);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, .62);
}

.dialog h3 {
  margin: 0 0 16px;
  font-size: 26px;
}

.dialog form {
  display: grid;
  gap: 12px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.secondary-button {
  background: var(--card);
  color: var(--yellow);
  border: 1px solid rgba(255, 230, 0, .38);
}

.history-view {
  min-height: 100vh;
  background: var(--paper);
}

.history-page-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.history-page-head h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.back-button {
  min-height: 38px;
  padding: 0 13px;
  background: var(--card);
  color: var(--yellow);
  border: 1px solid rgba(255, 230, 0, .38);
}

.history-page-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.history-item {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid rgba(255, 230, 0, .38);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 0 14px rgba(255, 230, 0, .12);
}

.history-item time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-item p {
  margin: 0;
  white-space: pre-wrap;
}

.history-meta {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.delete-button {
  min-height: 36px;
  justify-self: start;
  padding: 0 13px;
  background: var(--card-deep);
  color: var(--red);
  border: 1px solid rgba(255, 77, 53, .45);
}

@media (max-width: 380px) {
  .topbar {
    padding-inline: 12px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .login-mark {
    width: 66px;
    height: 66px;
  }

  .board-section {
    padding-inline: 12px;
  }

  .section-head h2 {
    font-size: 23px;
  }

  .text-link {
    font-size: 13px;
  }

  .yellow-card {
    aspect-ratio: 1 / 1.1;
  }
}
