@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.7);
  --accent-cyan: #0088cc;
  --accent-purple: #7b2cbf;
  --accent-purple-glow: rgba(123, 44, 191, 0.2);
  --accent-cyan-glow: rgba(0, 136, 204, 0.2);
  --text-primary: #12121e;
  --text-secondary: #53576b;
  --text-muted: #9499b3;
  --border-color: rgba(0, 0, 0, 0.1);
  --success: #28a745;
  --success-glow: rgba(40, 167, 69, 0.2);
  --error: #dc3545;
  --error-glow: rgba(220, 53, 69, 0.2);
  --font-sans: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --card-border-radius: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(123, 44, 191, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 136, 204, 0.08) 0%, transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
  margin: auto;
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }
}

/* Glassmorphic Panel/Card */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--card-border-radius);
  padding: 30px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  opacity: 0.7;
}

.glass-panel.success-glow {
  border-color: var(--success);
  box-shadow: 0 0 25px var(--success-glow);
}

.glass-panel.error-glow {
  border-color: var(--error);
  box-shadow: 0 0 25px var(--error-glow);
}

/* Title Section */
h1 {
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 25px;
  line-height: 1.5;
}

/* Main Password Console */
.console-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.console-intro {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  border-left: 2px solid var(--accent-cyan);
  padding-left: 12px;
  margin-bottom: -5px; /* offset some gap spacing */
}


/* Hidden input box that receives focus */
.hidden-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  z-index: -1;
}

/* Custom Password Input Box */
.password-input-container {
  min-height: 70px;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow-x: auto;
  scrollbar-width: thin;
}

.password-input-container:focus-within, .password-input-container.focused {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

/* Char List rendering */
.password-chars {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
}

.char-item-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.char-item {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
}

.char-item.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  text-shadow: 0 0 12px var(--accent-cyan-glow);
}

.char-item.masked {
  /* When password is hidden, render a bullet, but rotate it (which rotates a styled symbol instead of an actual dot) */
  font-size: 1.5rem;
}

.char-angle-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.2s, transform 0.2s;
}

.char-item-wrapper:hover .char-angle-badge,
.show-all-angles .char-angle-badge,
.char-item-wrapper.active-wrapper .char-angle-badge {
  opacity: 1;
  transform: translateY(0);
}

.char-item-wrapper.active-wrapper .char-angle-badge {
  color: var(--accent-cyan);
  font-weight: bold;
}


/* Custom Cursor */
.custom-cursor {
  width: 2px;
  height: 28px;
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan-glow);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

.custom-cursor.hidden {
  display: none;
}

/* Dial Gauge Panel */
.dial-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 25px;
  padding: 20px 0;
}

@media (max-width: 580px) {
  .dial-section {
    flex-direction: column;
    text-align: center;
  }
}

.dial-instructions {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 15px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.dial-instructions h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dial-instructions h3 svg {
  color: var(--accent-cyan);
}

.dial-instructions p {
  margin: 0;
}

.dial-instructions kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
}


.dial-outer {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s;
}

.dial-outer::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent-purple);
  border-bottom-color: var(--accent-cyan);
  animation: spin 12s linear infinite;
  opacity: 0.5;
}

.dial-pointer {
  position: absolute;
  width: 100%;
  height: 100%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.dial-pointer::after {
  content: '';
  position: absolute;
  top: 10px;
  left: calc(50% - 3px);
  width: 6px;
  height: 25px;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-purple));
  border-radius: 3px;
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.dial-center {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
  z-index: 2;
}

.dial-degree-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.dial-degree-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* Action Controls */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

button {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 14px 20px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-secondary);
}

button.primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, #7b2cbf 100%);
  border: none;
  box-shadow: 0 4px 15px var(--accent-purple-glow);
}

button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(157, 78, 221, 0.6);
}

button.primary:active {
  transform: translateY(1px);
}

/* Settings & Vault Config Side Panel */
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 15px;
}

.setting-row label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.input-styled {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.input-styled:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.combination-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  background: rgba(0,0,0,0.2);
  padding: 10px;
  border-radius: 8px;
  border: 1px dashed var(--border-color);
}

.combination-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  min-width: 54px;
  min-height: 68px;
  transition: border-color 0.2s, background-color 0.2s;
  position: relative;
  overflow: hidden;
}

.combination-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
  opacity: 0.4;
}

.combination-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-purple);
}

.combination-item span:first-child {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.combination-item .angle {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

/* Instructions card */
.instructions {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.instructions ul {
  padding-left: 20px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.instructions kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
}

/* Vault Graphics Container */
.vault-visual {
  width: 100%;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
}

/* Vault SVG & Animations */
.vault-wheel {
  transition: transform 1.5s cubic-bezier(0.25, 1, 0.5, 1);
  transform-origin: 64px 64px;
}

.vault-wheel.spinning {
  animation: spinVault 2.5s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

/* Sound and Visual Toggles */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 34px;
  border: 1px solid var(--border-color);
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-purple-glow);
  border-color: var(--accent-purple);
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: var(--accent-purple);
  box-shadow: 0 0 8px rgba(157, 78, 221, 0.6);
}

/* Animations */
@keyframes blink {
  from, to { background-color: transparent; }
  50% { background-color: var(--accent-cyan); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinVault {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Particle effect container */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent-cyan);
  opacity: 0.8;
  animation: shoot 1s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes shoot {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* Success Spin Animation for the Vault Wheel */
.vault-wheel.success-spin {
  animation: successRotate 2.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes successRotate {
  0% {
    transform: rotate(0deg) scale(1);
  }
  15% {
    transform: rotate(-45deg) scale(0.92);
  }
  50% {
    transform: rotate(1080deg) scale(1.22);
    filter: drop-shadow(0 0 15px var(--success-glow));
  }
  80% {
    transform: rotate(1080deg) scale(1.22);
    filter: drop-shadow(0 0 15px var(--success-glow));
  }
  100% {
    transform: rotate(1080deg) scale(1);
  }
}

/* Firework celebration particles */
.firework-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100;
  animation: explode 1.2s cubic-bezier(0.08, 0.8, 0.2, 1) forwards;
}

@keyframes explode {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }
  30% {
    opacity: 1;
  }
  100% {
    /* Explode out to tx, ty, and drift downwards by 60px (gravity simulation) */
    transform: translate3d(var(--tx), calc(var(--ty) + 60px), 0) scale(0.1);
    opacity: 0;
  }
}

