:root {
  --color-bg: #7a0019;
  --color-bg-secondary: #900021;
  --color-surface: rgba(249, 247, 246, 0.92);
  --color-surface-strong: rgba(255, 204, 51, 0.22);
  --color-text: #2b1a1a;
  --color-on-dark: #f9f7f6;
  --color-accent: #ffcc33;
  --color-accent-strong: #900021;
  --color-success: #2f9c5d;
  --color-warning: #ffcc33;
  --color-error: #c53030;
  --color-muted: #777677;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top left, rgba(255, 222, 122, 0.4) 0%, rgba(154, 0, 25, 0.92) 45%, #33000c 100%);
  color: var(--color-on-dark);
}

.kiosk-shell {
  width: min(720px, 94vw);
  padding: 36px 40px 42px;
  border-radius: 28px;
  background: var(--color-surface);
  box-shadow: 0 28px 65px rgba(34, 0, 7, 0.28);
  text-align: center;
  color: var(--color-text);
}

.kiosk-header h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: 0.02em;
  color: var(--color-accent-strong);
}

.subtitle {
  margin: 0 0 18px;
  color: var(--color-muted);
  font-size: 18px;
}

.cta-panel {
  position: relative;
  margin: 0 auto 28px;
  padding: 28px 32px 32px;
  border-radius: 32px;
  background: radial-gradient(circle at 20% 20%, rgba(255, 204, 51, 0.22), rgba(144, 0, 33, 0.18) 60%, rgba(144, 0, 33, 0.45));
  overflow: hidden;
  color: var(--color-accent-strong);
  box-shadow: 0 16px 45px rgba(34, 0, 7, 0.28);
  animation: ctaFloat 12s ease-in-out infinite;
}

.cta-panel.register-mode {
  background: radial-gradient(circle at 35% 25%, rgba(255, 230, 138, 0.32), rgba(255, 171, 64, 0.28) 50%, rgba(144, 0, 33, 0.5));
}

.cta-panel.hidden {
  display: none;
}

.cta-ring {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(255, 230, 138, 0.4) 0%, rgba(255, 230, 138, 0.08) 55%, rgba(255, 230, 138, 0) 70%);
  animation: ctaPulse 4.8s ease-in-out infinite;
}

.tap-graphic {
  position: absolute;
  top: clamp(4px, 2vw, 16px);
  right: clamp(8px, 3vw, 24px);
  width: clamp(110px, 32vw, 170px);
  height: clamp(110px, 32vw, 170px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.tap-hand {
  width: 72%;
  height: 72%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(242, 225, 204, 0.82));
  border-radius: 52% 48% 45% 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 6px 12px rgba(255, 255, 255, 0.35), 0 18px 36px rgba(34, 0, 7, 0.28);
  animation: tapHand 3.6s ease-in-out infinite;
}

.tap-card {
  display: block;
  width: 48%;
  height: 58%;
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(138, 0, 28, 0.92), rgba(99, 0, 21, 0.88));
  position: relative;
  transform: rotate(-12deg);
  box-shadow: 0 0 0 3px rgba(255, 230, 138, 0.55), 0 10px 18px rgba(34, 0, 7, 0.28);
}

.tap-card::before,
.tap-card::after {
  content: '';
  position: absolute;
  left: 16%;
  right: 16%;
  border-radius: 12px;
  background: rgba(255, 230, 138, 0.38);
}

.tap-card::before {
  top: 18%;
  height: 18%;
}

.tap-card::after {
  bottom: 18%;
  height: 12%;
}

.tap-wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 215, 128, 0.45);
  opacity: 0;
  transform: scale(0.55);
  animation: tapWave 3.6s ease-out infinite;
}

.tap-wave-one {
  animation-delay: 0s;
}

.tap-wave-two {
  animation-delay: 0.6s;
}

.tap-wave-three {
  animation-delay: 1.2s;
}

.cta-content {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  color: var(--color-on-dark);
  text-shadow: 0 4px 12px rgba(34, 0, 7, 0.4);
}

.cta-lead {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cta-sub {
  font-size: clamp(16px, 2.4vw, 20px);
  color: rgba(249, 247, 246, 0.85);
  letter-spacing: 0.04em;
}

.status {
  margin: 18px auto 24px;
  padding: 18px;
  border-radius: 16px;
  background: var(--color-surface);
  border: 1px solid rgba(121, 0, 25, 0.12);
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  transition: background 0.3s ease, border 0.3s ease;
  color: var(--color-text);
}

.status-message {
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 700;
}

.status-detail {
  font-size: 16px;
  color: var(--color-muted);
}

.status-detail.hidden {
  display: none;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.status-actions button {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(122, 0, 25, 0.12);
  color: var(--color-accent-strong);
}

.status-actions button.primary {
  background: var(--color-accent);
  color: #3b1d00;
}

.status-actions button.danger {
  background: var(--color-error);
  color: var(--color-on-dark);
}

.status-idle {
  background: var(--color-surface);
}

.status-waiting {
  background: rgba(255, 204, 51, 0.16);
  border-color: rgba(255, 204, 51, 0.45);
  color: #6b3d00;
}

.status-success {
  background: rgba(47, 156, 93, 0.16);
  border-color: rgba(47, 156, 93, 0.4);
  color: var(--color-success);
}

.status-error {
  background: rgba(197, 48, 48, 0.18);
  border-color: rgba(197, 48, 48, 0.45);
  color: var(--color-error);
}

.status-info {
  background: rgba(144, 0, 33, 0.12);
  border-color: rgba(144, 0, 33, 0.35);
  color: var(--color-accent-strong);
}

.primary-actions {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 28px;
}

.action-button {
  padding: 24px;
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 700;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  background: var(--color-accent);
  color: #3b1d00;
  box-shadow: 0 18px 34px rgba(122, 0, 25, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.action-button:not(:disabled):active {
  transform: scale(0.98);
  box-shadow: 0 12px 26px rgba(51, 0, 12, 0.28);
}

.action-register {
  background: linear-gradient(135deg, #ffcc33, #ffde7a);
  color: #3b1d00;
}

.action-secondary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 204, 51, 0.22));
  color: var(--color-accent-strong);
  box-shadow: 0 14px 28px rgba(34, 0, 7, 0.2);
}

.helper-text {
  margin-top: 30px;
  color: var(--color-muted);
  font-size: 15px;
}

.clock {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-accent-strong);
}

.promo-banner {
  position: relative;
  margin: 28px auto 12px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 204, 51, 0.92), rgba(255, 222, 122, 0.95));
  color: #3b1d00;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  overflow: hidden;
  box-shadow: 0 18px 30px rgba(255, 204, 51, 0.35);
  pointer-events: none;
}

.promo-sparkle {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0%, rgba(255, 204, 51, 0) 60%);
  animation: shimmer 4s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.promo-text {
  position: relative;
  z-index: 1;
}

@keyframes shimmer {
  from {
    transform: translateX(-20%) rotate(0deg);
  }
  to {
    transform: translateX(20%) rotate(360deg);
  }
}

.flash-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 6, 6, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.flash-overlay:not(.hidden) {
  display: flex;
}

.flash-content {
  background: linear-gradient(135deg, #ffcc33, #ffde7a);
  padding: 28px 42px;
  border-radius: 24px;
  color: #3b1d00;
  box-shadow: 0 24px 60px rgba(51, 0, 12, 0.35);
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 6, 9, 0.88);
  z-index: 1500;
}

.busy-overlay:not(.hidden) {
  display: flex;
}

.busy-card {
  padding: 32px 46px;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 235, 210, 0.96), rgba(248, 210, 224, 0.98));
  color: #320009;
  box-shadow: 0 26px 58px rgba(24, 0, 10, 0.45);
  text-align: center;
  max-width: min(540px, 92vw);
}

.busy-card h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.busy-detail {
  margin: 0;
  font-size: clamp(18px, 3vw, 24px);
  color: rgba(50, 0, 9, 0.82);
}

.busy-detail.hidden {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 0, 13, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  width: min(640px, 94vw);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 28px 30px;
  border-radius: 24px;
  box-shadow: 0 24px 55px rgba(51, 0, 12, 0.35);
}

.overlay-content h2 {
  margin: 0 0 6px;
  font-size: clamp(24px, 4vw, 30px);
}

.overlay-keyboard {
  width: min(760px, 94vw);
}

.overlay-keyboard.register-mode {
  background: linear-gradient(180deg, rgba(255, 236, 179, 0.92), rgba(255, 245, 225, 0.96));
  box-shadow: 0 28px 60px rgba(144, 0, 33, 0.25);
}

.keyboard-banner {
  display: none;
  margin: -8px auto 12px;
  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(144, 0, 33, 0.9);
  color: var(--color-on-dark);
  font-size: clamp(20px, 3.6vw, 28px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(34, 0, 7, 0.25);
}

.overlay-keyboard.register-mode .keyboard-banner {
  display: block;
}

.overlay-keyboard.register-mode h2 {
  font-size: clamp(26px, 4vw, 34px);
  color: var(--color-accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overlay-keyboard.register-mode .overlay-hint {
  font-size: clamp(16px, 2.6vw, 20px);
  color: rgba(59, 8, 16, 0.8);
  font-weight: 600;
}

.overlay-equipment {
  width: min(820px, 94vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}

.overlay-header {
  margin-bottom: 12px;
  text-align: left;
}

.overlay-hint {
  margin: 0 0 18px;
  color: var(--color-muted);
}

.overlay-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 204, 51, 0.18);
  margin-bottom: 18px;
  font-size: clamp(20px, 4vw, 26px);
  min-height: 52px;
}

.overlay-display {
  flex: 1;
  text-align: left;
  letter-spacing: 0.08em;
}

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

.key {
  padding: 16px 0;
  border-radius: 12px;
  border: none;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(122, 0, 25, 0.12);
  color: var(--color-text);
  transition: transform 0.1s ease, background 0.1s ease;
}

.key:active {
  transform: scale(0.96);
  background: rgba(122, 0, 25, 0.22);
}

.key-action {
  padding: 14px 16px;
  background: rgba(122, 0, 25, 0.24);
  color: var(--color-on-dark);
}

.key-secondary {
  background: rgba(213, 214, 210, 0.65);
  color: #3b3a3a;
}

.key-secondary:active {
  background: rgba(213, 214, 210, 0.85);
}

.key-primary {
  background: var(--color-accent);
  color: #3b1d00;
}

.key-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.overlay-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.equipment-loader {
  text-align: center;
  padding: 24px 0;
  color: var(--color-muted);
  font-size: 16px;
}

.equipment-list {
  flex: 1;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
  padding-right: 4px;
}

.equipment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(249, 247, 246, 0.85);
  box-shadow: inset 0 0 0 1px rgba(144, 0, 33, 0.08);
}

.equipment-card.available {
  box-shadow: inset 0 0 0 2px rgba(47, 156, 93, 0.28);
}

.equipment-card.unavailable {
  opacity: 0.82;
}

.equipment-info {
  text-align: left;
}

.equipment-name {
  font-size: 18px;
  font-weight: 700;
}

.equipment-uid {
  font-size: 14px;
  color: var(--color-muted);
}

.equipment-status {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
}

.equipment-status.available {
  background: rgba(47, 156, 93, 0.16);
  color: var(--color-success);
}

.equipment-status.unavailable {
  background: rgba(197, 48, 48, 0.18);
  color: var(--color-error);
}

.equipment-empty {
  text-align: center;
  color: var(--color-muted);
  font-size: 16px;
  margin: 12px 0;
}

.overlay-projects {
  width: min(880px, 96vw);
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.projects-loader {
  text-align: center;
  padding: 32px 0;
  color: var(--color-muted);
  font-size: 18px;
}

.projects-board {
  display: block;
  margin-top: 8px;
}

.aim-connect-host {
  width: 100%;
}

.aim-connect-frame {
  width: 100%;
  min-height: 68vh;
  border: 1px solid rgba(144, 0, 33, 0.24);
  border-radius: 16px;
  background: #12030b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 14px 32px rgba(35, 0, 8, 0.22);
}

@keyframes tapHand {
  0%,
  100% {
    transform: translateY(6px) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.04);
  }
}

@keyframes tapWave {
  0% {
    opacity: 0.45;
    transform: scale(0.55);
  }
  55% {
    opacity: 0.22;
    transform: scale(1.2);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

@keyframes boardCardIn {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ctaPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.7;
  }
}

@keyframes ctaFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@media (max-width: 540px) {
  .kiosk-shell {
    padding: 18px 20px 26px;
  }
  .overlay-content {
    padding: 20px;
  }
  .overlay-keyboard,
  .overlay-equipment,
  .overlay-projects {
    width: 96vw;
  }
  .aim-connect-frame {
    min-height: 60vh;
  }
  .tap-graphic {
    position: static;
    margin: 0 auto 14px;
  }
  .cta-lead {
    font-size: 26px;
  }
  .keyboard-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
