@font-face {
  font-family: "Glitch Inside";
  src: url("./fonts/Glitch-inside.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Future Z";
  src: url("./fonts/Future-Z.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Vipnagorgialla";
  src: url("./fonts/Vipnagorgialla-Rg.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Liberation Sans Local";
  src: url("./fonts/LiberationSans.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #0a0c10;
  --panel: #151a20;
  --panel-2: #10151a;
  --text: #f5f7fb;
  --muted: #aeb7c2;
  --line: #28313b;
  --primary: #e6b844;
  --primary-text: #15120a;
  --green: #28d867;
  --danger: #ff5656;
  font-family: "Liberation Sans Local", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100svh;
  -webkit-user-select: none;
  user-select: none;
}

.lock-screen,
.app-shell {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

.lock-screen {
  display: grid;
  align-items: center;
  width: min(100%, 720px);
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto auto auto;
  gap: 12px;
}

.lock-card,
.sales-card,
.selection-card,
.confirm-card,
.date-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: 8px;
  padding: 14px;
}

.lock-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  text-align: center;
}

.lock-card .brand-lockup {
  width: min(100%, 560px);
  text-align: center;
  text-align-last: center;
}

.lock-card .brand-title {
  font-size: clamp(33px, 6.8vw, 54px);
  text-align: center;
  text-align-last: center;
}

.lock-card .brand-subtitle {
  font-size: clamp(10px, 2.35vw, 18px);
}

.top-panel {
  position: relative;
  padding-top: 28px;
  text-align: center;
}

.brand-lockup {
  width: min(100%, 420px);
  margin: 8px auto 0;
  text-align: center;
  text-align-last: center;
}

h1,
.brand-title {
  display: block;
  width: 100%;
  margin: 4px 0 0;
  color: #ff2300;
  font-family: "Glitch Inside", "Liberation Sans Local", Arial, Helvetica, sans-serif;
  font-size: clamp(27px, 6.8vw, 42px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  position: relative;
  text-align: center;
  text-align-last: center;
  text-shadow: 0 0 4px rgba(255, 35, 0, 0.38), 2px 0 0 rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-title::before,
.brand-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.45;
  pointer-events: none;
}

.brand-title::before {
  color: rgba(0, 216, 255, 0.5);
  animation: title-glitch-a 2.7s infinite steps(2, end);
}

.brand-title::after {
  color: rgba(255, 230, 68, 0.42);
  animation: title-glitch-b 3.4s infinite steps(2, end);
}

.brand-subtitle {
  display: block;
  width: 100%;
  margin: -2px 0 0;
  color: #dbcb5a;
  font-family: "Future Z", "Liberation Sans Local", Arial, Helvetica, sans-serif;
  font-size: clamp(8px, 2.55vw, 15px);
  line-height: 1;
  text-align: center;
  text-align-last: center;
  text-shadow: 0 0 4px rgba(219, 203, 90, 0.28);
  text-transform: uppercase;
  white-space: nowrap;
}

.top-panel .brand-lockup {
  width: min(100%, 430px);
}

.top-panel .brand-title {
  font-size: clamp(31px, 7.5vw, 46px);
  transform: scaleX(0.82);
  transform-origin: center;
}

.top-panel .brand-subtitle {
  font-size: clamp(8px, 2.35vw, 15px);
  transform: scaleX(0.9);
  transform-origin: center;
}

.top-panel .brand-title::before,
.top-panel .brand-title::after {
  display: none;
}

.password-status,
.password-input,
.password-input::placeholder,
.password-submit {
  font-family: "Vipnagorgialla", "Liberation Sans Local", Arial, Helvetica, sans-serif;
}

.password-status {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.password-input,
.date-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #07090c;
  color: var(--text);
  font-size: 18px;
  text-align: center;
  -webkit-user-select: text;
  user-select: text;
}

.password-input::placeholder,
.date-input::placeholder {
  color: rgba(245, 247, 251, 0.48);
}

.lock-button,
.refresh-button {
  position: absolute;
  top: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #202833;
  color: var(--muted);
  font-weight: 700;
}

.lock-button {
  left: 0;
}

.refresh-button {
  right: 0;
  color: var(--text);
}

.total-text {
  display: block;
  margin-top: 14px;
  color: var(--green);
  font-family: "Future Z", "Liberation Sans Local", Arial, Helvetica, sans-serif;
  font-size: clamp(34px, 10vw, 58px);
  line-height: 1;
}

.status {
  min-height: 24px;
  margin: 8px 0 0;
  color: var(--text);
  font-size: 18px;
}

.sales-card {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.sales-list {
  height: 100%;
  min-height: 260px;
  max-height: 48svh;
  overflow-y: auto;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
}

.sale-row {
  width: 100%;
  min-height: 38px;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  padding: 0 10px;
  background: #10171d;
  color: var(--text);
  font-family: "Liberation Sans Local", Arial, Helvetica, sans-serif;
  font-size: 13px;
  text-align: center;
}

.sale-row.selected {
  border-color: var(--primary);
  background: #24210f;
}

.empty {
  padding: 24px 8px;
  color: var(--muted);
  text-align: center;
}

.selection-card,
.confirm-card {
  display: grid;
  gap: 10px;
}

.selection-card p,
.confirm-card p {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.date-card {
  display: grid;
  gap: 10px;
}

.date-row,
.quick-actions,
.confirm-actions {
  display: grid;
  gap: 10px;
}

.date-row {
  grid-template-columns: 1fr 120px;
}

.quick-actions {
  grid-template-columns: repeat(3, 1fr);
}

.confirm-actions {
  grid-template-columns: 1fr 1fr;
}

.button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: #303945;
  color: var(--text);
  font-family: "Future Z", "Liberation Sans Local", Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.primary {
  background: var(--primary);
  color: var(--primary-text);
}

.secondary {
  background: #303945;
}

.danger {
  background: var(--danger);
  color: #190505;
}

[hidden] {
  display: none !important;
}

@keyframes title-glitch-a {
  0%, 88%, 100% {
    clip-path: inset(0 0 0 0);
    transform: translate(-1px, 0);
  }
  89% {
    clip-path: inset(10% 0 62% 0);
    transform: translate(-5px, -1px);
  }
  91% {
    clip-path: inset(60% 0 12% 0);
    transform: translate(3px, 1px);
  }
}

@keyframes title-glitch-b {
  0%, 80%, 100% {
    clip-path: inset(0 0 0 0);
    transform: translate(1px, 0);
  }
  81% {
    clip-path: inset(44% 0 28% 0);
    transform: translate(4px, 1px);
  }
  83% {
    clip-path: inset(18% 0 58% 0);
    transform: translate(-3px, -1px);
  }
}
