:root {
  --bg: #11171c;
  --panel: #1b232b;
  --panel-strong: #241921;
  --paper: #fff8e8;
  --paper-edge: #e3d0ae;
  --ink: #221f20;
  --muted: #b7c3c9;
  --gold: #e8bf62;
  --red: #e84d5b;
  --green: #2fbf7a;
  --blue: #58b9ff;
  --plum: #8b4567;
  --shadow: rgba(0, 0, 0, 0.36);
  --deep-shadow: rgba(0, 0, 0, 0.52);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  font-family: "Mali", "Segoe UI", Tahoma, sans-serif;
  background:
    linear-gradient(118deg, rgba(232, 77, 91, 0.18), transparent 32%),
    linear-gradient(242deg, rgba(88, 185, 255, 0.13), transparent 34%),
    linear-gradient(135deg, #11171c, #21151d 56%, #10221b);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

input,
select,
textarea {
  font-size: 16px;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.game-shell {
  width: min(1040px, calc(100% - 20px));
  margin: 0 auto;
  padding: 14px 0 28px;
  display: grid;
  gap: 14px;
}

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

.title-block {
  display: grid;
  gap: 10px;
}

.back-link {
  width: max-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: rgba(255, 248, 232, 0.9);
  background: rgba(8, 13, 17, 0.46);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
}

h1 {
  margin: 0;
  color: #fff8e8;
  font-size: 2.32rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

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

.status-pill {
  min-height: 68px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 11px 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(8, 13, 17, 0.5);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.status-pill span {
  color: #fff8e8;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.12;
}

.status-pill small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.25;
}

.setup-screen {
  width: min(100%, 640px);
  justify-self: center;
  display: grid;
  gap: 12px;
}

.setup-card,
.history-panel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(43, 28, 38, 0.94), rgba(20, 28, 35, 0.97));
  box-shadow: 0 20px 38px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.setup-card {
  padding: 12px;
}

.custom-field {
  display: grid;
  gap: 10px;
}

.field-heading,
.history-heading span {
  color: rgba(255, 248, 232, 0.84);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}

.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-heading strong {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid rgba(232, 191, 98, 0.28);
  border-radius: 999px;
  color: #fff3bd;
  background: rgba(232, 191, 98, 0.11);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.add-card-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(84px, 0.28fr);
  gap: 8px;
}

.add-card-form input {
  min-width: 0;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  outline: 0;
  padding: 0 14px;
  color: var(--paper);
  caret-color: var(--gold);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 54%),
    rgba(6, 9, 12, 0.62);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.28);
  font-size: 1rem;
}

.add-card-form input:focus {
  border-color: var(--gold);
  box-shadow:
    0 0 0 3px rgba(232, 191, 98, 0.18),
    inset 0 2px 12px rgba(0, 0, 0, 0.28);
}

.add-card-form input::placeholder {
  color: rgba(255, 248, 232, 0.45);
}

.add-btn {
  min-height: 54px;
  border: 0;
  border-radius: 10px;
  color: #1d1607;
  background: linear-gradient(180deg, #fff0a8, var(--gold));
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
  font-weight: 600;
  line-height: 1.25;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.add-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.add-btn:disabled {
  opacity: 0.55;
}

.card-editor-list {
  max-height: min(54vh, 520px);
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(6, 9, 12, 0.42);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.18);
  scrollbar-color: rgba(232, 191, 98, 0.55) rgba(255, 255, 255, 0.05);
}

.card-editor-list.is-empty {
  min-height: 112px;
  place-items: center;
  border-color: rgba(232, 77, 91, 0.5);
}

.editor-empty {
  color: rgba(255, 248, 232, 0.62);
  font-weight: 400;
}

.editor-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 58%),
    rgba(255, 255, 255, 0.06);
  animation: historyIn 260ms cubic-bezier(0.18, 0.86, 0.2, 1.18) both;
}

.editor-text {
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(255, 248, 232, 0.92);
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.48;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.delete-card-btn {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: #fff8e8;
  background: rgba(232, 77, 91, 0.18);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}

.delete-card-btn:hover {
  background: rgba(232, 77, 91, 0.34);
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.card-editor-list::-webkit-scrollbar {
  width: 12px;
}

.card-editor-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.card-editor-list::-webkit-scrollbar-thumb {
  border: 3px solid rgba(6, 9, 12, 0.72);
  border-radius: 999px;
  background: rgba(232, 191, 98, 0.72);
}

.setup-actions,
.controls {
  display: grid;
  gap: 8px;
}

.setup-actions {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  margin-top: 10px;
}

.primary-btn,
.secondary-btn,
.draw-btn {
  min-height: 52px;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1.25;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.primary-btn,
.draw-btn {
  border: 0;
  color: #1d1607;
  background: linear-gradient(180deg, #fff0a8, var(--gold));
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(232, 191, 98, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.secondary-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 248, 232, 0.92);
  background: rgba(255, 255, 255, 0.09);
}

.primary-btn:hover,
.secondary-btn:hover,
.draw-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.draw-btn:hover:not(:disabled) {
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 32px rgba(232, 191, 98, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.draw-btn {
  min-height: 64px;
  font-size: 1.16rem;
}

.draw-btn:disabled {
  opacity: 0.62;
}

.play-screen {
  display: grid;
  gap: 12px;
}

.is-hidden {
  display: none;
}

.table {
  position: relative;
  min-height: 450px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 24px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 24% 78%, rgba(0, 0, 0, 0.16)),
    repeating-linear-gradient(36deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 10px),
    linear-gradient(140deg, rgba(99, 31, 48, 0.94), rgba(13, 69, 48, 0.98));
  box-shadow:
    0 24px 50px var(--deep-shadow),
    inset 0 0 0 9px rgba(0, 0, 0, 0.16),
    inset 0 26px 80px rgba(255, 255, 255, 0.04);
  perspective: 1200px;
}

.table::before,
.table::after {
  content: "";
  position: absolute;
  inset: 11px;
  z-index: 0;
  pointer-events: none;
  border-radius: 10px;
}

.table::before {
  border: 1px solid rgba(232, 191, 98, 0.5);
  box-shadow:
    inset 0 0 42px rgba(232, 191, 98, 0.1),
    0 0 24px rgba(232, 191, 98, 0.08);
}

.table::after {
  border: 1px dashed rgba(255, 248, 232, 0.24);
  background:
    linear-gradient(90deg, transparent 0 34%, rgba(255, 255, 255, 0.07) 48%, transparent 62% 100%);
  opacity: 0.78;
  animation: tableSweep 4.8s ease-in-out infinite;
}

.table-glow {
  position: absolute;
  inset: -20%;
  z-index: 0;
  background:
    conic-gradient(from 0deg, transparent, rgba(232, 191, 98, 0.22), transparent, rgba(88, 185, 255, 0.18), transparent, rgba(232, 77, 91, 0.2), transparent);
  opacity: 0.58;
  mix-blend-mode: screen;
  animation: tableSpin 11s linear infinite;
}

.table.is-drawing .table-glow {
  animation-duration: 1.4s;
  opacity: 0.95;
}

.table.is-final {
  animation: tableHit 820ms ease both;
}

.table.is-final::before {
  animation: borderKick 820ms ease both;
}

.luck-card {
  position: relative;
  z-index: 2;
  width: min(74vw, 310px);
  aspect-ratio: 5 / 7;
  transform-style: preserve-3d;
}

.luck-card::before,
.luck-card::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.luck-card::before {
  left: 8%;
  right: 8%;
  bottom: -24px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  filter: blur(16px);
  transform: rotateX(62deg);
}

.luck-card::after {
  inset: 8px;
  z-index: 0;
  border-radius: 18px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 248, 232, 0.14) 0 3px, transparent 3px 13px),
    linear-gradient(135deg, #6f2236, #1c344f 52%, #0d3a28);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    13px 12px 0 rgba(13, 18, 23, 0.45),
    -12px 16px 0 rgba(13, 18, 23, 0.26);
  transform: rotate(-5deg) translate(12px, 16px);
  opacity: 0.72;
}

.card-inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-style: preserve-3d;
  transition: transform 620ms cubic-bezier(0.15, 0.86, 0.18, 1.12);
}

.luck-card.is-open .card-inner {
  transform: rotateY(180deg) rotateZ(-1.2deg);
}

.luck-card.is-drawing {
  animation: cardDeal 560ms cubic-bezier(0.17, 0.85, 0.22, 1.12) both;
}

.luck-card.is-open {
  animation: cardLand 420ms cubic-bezier(0.18, 0.86, 0.2, 1.2) 280ms both;
}

.card-back,
.card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 18px;
  backface-visibility: hidden;
  box-shadow: 0 26px 42px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.card-back {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px;
  color: #fff8e8;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 32% 72%, rgba(0, 0, 0, 0.14)),
    repeating-linear-gradient(45deg, rgba(255, 248, 232, 0.16) 0 3px, transparent 3px 13px),
    linear-gradient(135deg, #9d2841, #253f66 52%, #0e5136);
  border: 1px solid rgba(255, 255, 255, 0.25);
  animation: backPulse 3.2s ease-in-out infinite;
}

.card-back::before {
  content: "";
  position: absolute;
  inset: 13px;
  border: 2px solid rgba(255, 248, 232, 0.44);
  border-radius: 12px;
}

.back-corner {
  position: relative;
  z-index: 1;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
}

.back-corner.bottom {
  justify-self: end;
  align-self: end;
  transform: rotate(180deg);
}

.back-mark {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: min(62%, 160px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid rgba(255, 248, 232, 0.62);
  color: #fff8e8;
  background: rgba(8, 13, 17, 0.26);
  font-size: 1.8rem;
  font-weight: 600;
  box-shadow: inset 0 0 28px rgba(255, 248, 232, 0.12);
}

.card-face {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  padding: 20px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), transparent 34%),
    linear-gradient(180deg, rgba(232, 191, 98, 0.14), transparent 32%),
    var(--paper);
  border: 1px solid var(--paper-edge);
  transform: rotateY(180deg);
}

.card-face::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(139, 69, 103, 0.22);
  border-radius: 12px;
  pointer-events: none;
}

.face-kicker {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  color: #fff8e8;
  background: linear-gradient(135deg, #8b283f, #0f5137);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
}

.card-face p {
  position: relative;
  z-index: 1;
  align-self: center;
  margin: 0;
  color: #251d1f;
  font-size: 1.42rem;
  font-weight: 600;
  line-height: 1.34;
  text-align: center;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.burst-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.spark {
  --x: 0px;
  --y: 0px;
  --delay: 0ms;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 18px;
  border-radius: 2px;
  background: hsl(var(--h), 86%, 62%);
  transform: translate(-50%, -50%);
  animation: sparkBurst 860ms cubic-bezier(0.16, 0.86, 0.2, 1) var(--delay) both;
}

.spark.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 16px hsl(var(--h), 86%, 62%);
}

.spark.wide {
  width: 22px;
  height: 7px;
  border-radius: 999px;
}

.shock-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 240, 168, 0.9);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.25);
  animation: shockRing 780ms ease-out both;
}

.flash-streak {
  position: absolute;
  left: -28%;
  top: 18%;
  z-index: 1;
  width: 28%;
  height: 64%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), rgba(88, 185, 255, 0.26), transparent);
  transform: skewX(-18deg) translateX(-120%);
  mix-blend-mode: screen;
  animation: flashStreak 560ms cubic-bezier(0.18, 0.84, 0.18, 1) both;
}

.controls {
  grid-template-columns: minmax(0, 1fr) minmax(118px, 0.42fr);
}

.history-panel {
  padding: 12px;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-height: 92px;
}

.history-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(227, 208, 174, 0.7);
  border-radius: 10px;
  padding: 10px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: historyIn 340ms cubic-bezier(0.18, 0.86, 0.2, 1.18) both;
}

.history-card span {
  color: #8b283f;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}

.history-card p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.empty-history {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: rgba(255, 248, 232, 0.62);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 400;
}

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

@keyframes tableSweep {
  0%,
  38% {
    background-position: -260px 0;
    opacity: 0.42;
  }
  72%,
  100% {
    background-position: 260px 0;
    opacity: 0.84;
  }
}

@keyframes tableHit {
  0%,
  100% {
    filter: brightness(1);
  }
  42% {
    filter: brightness(1.12) saturate(1.18);
  }
}

@keyframes borderKick {
  0%,
  100% {
    border-color: rgba(232, 191, 98, 0.5);
  }
  42% {
    border-color: rgba(255, 240, 168, 0.92);
    box-shadow:
      inset 0 0 52px rgba(255, 240, 168, 0.18),
      0 0 36px rgba(255, 240, 168, 0.18);
  }
}

@keyframes cardDeal {
  0% {
    transform: translateY(-44px) rotateZ(-7deg) scale(0.9);
    opacity: 0.4;
  }
  34% {
    transform: translateY(-8px) rotateZ(5deg) scale(1.04);
    opacity: 1;
  }
  58% {
    transform: translateY(8px) rotateZ(-2deg) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translateY(0) rotateZ(0) scale(1);
    opacity: 1;
  }
}

@keyframes cardLand {
  0% {
    filter: brightness(1);
  }
  44% {
    filter: brightness(1.12);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes backPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

@keyframes sparkBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) scale(0.45);
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(520deg) scale(0.76);
  }
}

@keyframes shockRing {
  0% {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(0.25);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(14);
  }
}

@keyframes flashStreak {
  0% {
    opacity: 0;
    transform: skewX(-18deg) translateX(-120%);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: skewX(-18deg) translateX(650%);
  }
}

@keyframes historyIn {
  0% {
    opacity: 0;
    transform: translateY(-8px) rotateZ(-2deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateZ(0);
  }
}

@media (min-width: 780px) {
  body {
    display: grid;
    place-items: center;
  }

  .game-shell {
    padding: 28px 0;
    gap: 18px;
  }

  .top-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  h1 {
    font-size: 4.2rem;
  }

  .status-row {
    width: 260px;
  }

  .setup-screen {
    width: min(100%, 680px);
  }

  .setup-card {
    padding: 18px;
  }

  .card-editor-list {
    max-height: min(42vh, 420px);
  }

  .play-screen {
    gap: 18px;
  }

  .table {
    min-height: 580px;
    padding: 34px;
  }

  .luck-card {
    width: min(42vw, 340px);
  }

  .controls {
    grid-template-columns: minmax(220px, 0.72fr) minmax(130px, 0.28fr);
  }

  .history-panel {
    padding: 16px;
  }

  .history-list {
    min-height: 116px;
  }

  .history-card,
  .empty-history {
    min-height: 116px;
  }

  .card-face p {
    font-size: 1.92rem;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 2rem;
  }

  .setup-actions,
  .controls {
    grid-template-columns: 1fr;
  }

  .status-row {
    grid-template-columns: 1fr;
  }

  .table {
    min-height: 410px;
    padding: 14px;
  }

  .luck-card {
    width: min(82vw, 270px);
  }

  .card-face {
    padding: 16px;
  }

  .card-face p {
    font-size: 1.2rem;
  }

  .add-card-form {
    grid-template-columns: 1fr;
  }

  .card-editor-list {
    max-height: 430px;
  }

  .history-list {
    grid-template-columns: 1fr;
  }
}
