:root {
  /* Color Variables */
  --color-background: #0a0a0a;
  --color-text-primary: #00ff00;
  --color-text-secondary: #00aa00;
  --color-element-bg: #000;
  --color-key-bg: #001a00;
  --color-key-bg-hover: #003300;
  --color-border: #00ff00;
  --color-divider: #003300;

  /* Glow/Shadow Variables */
  --glow-intensity-low: rgba(0, 255, 0, 0.2);
  --glow-intensity-medium: rgba(0, 255, 0, 0.3);
  --glow-intensity-high: rgba(0, 255, 0, 0.5);
  --glow-size-small: 10px;
  --glow-size-medium: 20px;
  --glow-size-large: 30px;
}

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

body {
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: 'Courier New', monospace;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

/* Side-by-side layout for larger screens */
@media (min-width: 768px) {
  body {
    height: 100vh;
  }

  .main-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex: 1;
    overflow: hidden;
  }

  .left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
}

.header {
  text-align: center;
  margin-bottom: 15px;
}

h1 {
  font-size: 24px;
  letter-spacing: 3px;
  text-shadow: 0 0 var(--glow-size-small) var(--color-text-primary);
}

.instruction {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 5px;
}

.display {
  background: var(--color-element-bg);
  border: 2px solid var(--color-border);
  padding: 15px;
  margin-bottom: 15px;
  min-height: 50px;
  font-size: 18px;
  text-align: center;
  box-shadow: 0 0 var(--glow-size-medium) var(--glow-intensity-medium);
}

.contacts {
  background: var(--color-element-bg);
  border: 2px solid var(--color-border);
  padding: 15px;
  margin-bottom: 15px;
  flex: 1;
  overflow-y: auto;
  box-shadow: 0 0 var(--glow-size-medium) var(--glow-intensity-medium);
}

/* On larger screens, remove bottom margin */
@media (min-width: 768px) {
  .display {
    margin-bottom: 0;
  }

  .contacts {
    margin-bottom: 0;
  }
}

.contact {
  padding: 8px;
  border-bottom: 1px solid var(--color-divider);
  font-size: 16px;
}

.contact:last-child {
  border-bottom: none;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 400px;
  margin: 0 auto;
}

/* Larger keypad on bigger screens */
@media (min-width: 768px) {
  .keypad {
    max-width: none;
    flex: 1;
  }

  /* Center keypad vertically on larger screens */
  .right-column {
    justify-content: center;
  }
}

.key {
  background: var(--color-key-bg);
  border: 2px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: 24px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 0 0 var(--glow-size-small) var(--glow-intensity-low);
  aspect-ratio: 1;
  height: 100%;
}

.key:hover {
  background: var(--color-key-bg-hover);
  box-shadow: 0 0 var(--glow-size-medium) var(--glow-intensity-high);
}

.key:active {
  background: var(--color-text-primary);
  color: var(--color-element-bg);
}

.key-letters {
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.redirecting {
  color: var(--color-text-primary);
  animation: blink 0.5s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
