:root {
  --background: #081018;
  --foreground: #edf3f5;
  --surface: #101a24;
  --line: rgba(173, 204, 214, 0.17);
  --accent: #7ee7c8;
  --accent-strong: #ffd166;
  --font-sans:
    "Avenir Next", "Segoe UI", "Helvetica Neue", "Nimbus Sans", Arial, sans-serif;
  --font-mono:
    "SFMono-Regular", "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at 18% 15%, rgba(126, 231, 200, 0.14), transparent 26%),
    radial-gradient(circle at 85% 22%, rgba(255, 209, 102, 0.12), transparent 24%),
    linear-gradient(180deg, #071019 0%, #081018 48%, #0c1620 100%);
  background-attachment: fixed;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: transparent;
  background-image:
    linear-gradient(rgba(173, 204, 214, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(173, 204, 214, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background-color: rgba(139, 211, 221, 0.35);
  color: #f8fafc;
}

.page {
  min-height: 100vh;
  overflow: hidden;
  padding: 1.5rem;
}

.shell-wrap {
  margin: 0 auto;
  display: flex;
  min-height: calc(100vh - 3rem);
  width: 100%;
  max-width: 72rem;
  align-items: center;
}

.shell {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: rgba(16, 26, 36, 0.7);
  backdrop-filter: blur(12px);
  padding: 1.25rem;
}

.terminal {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: rgba(0, 0, 0, 0.4);
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem;
  font: 11px/1 var(--font-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #71717a;
}

.traffic-lights {
  display: flex;
  gap: 0.5rem;
}

.light {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
}

.red { background: #ff5f57; }
.yellow { background: #febc2e; }
.green { background: #28c840; }

.terminal-body {
  height: 28rem;
  overflow-y: auto;
  padding: 1rem;
  font: 0.875rem/1.75 var(--font-mono);
  color: #d4d4d8;
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
}

.line.app-view {
  line-height: 1.2;
  color: var(--accent);
}

.snake-food {
  color: #ff5f57;
}

.line-prefix {
  margin-right: 0.75rem;
}

.line-prefix.command {
  color: var(--accent-strong);
}

.line-prefix.output {
  color: #52525b;
}

.terminal-form {
  display: flex;
  align-items: center;
}

.app-controls {
  display: flex;
  justify-content: center;
  padding: 0 1rem 1rem;
}

.app-controls[hidden] {
  display: none;
}

.joystick-base {
  position: relative;
  width: 8rem;
  height: 8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(126, 231, 200, 0.08), transparent 52%),
    rgba(16, 26, 36, 0.92);
  box-shadow: inset 0 0 0 1px rgba(126, 231, 200, 0.06);
  touch-action: none;
}

.joystick-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(126, 231, 200, 0.24);
  border-radius: 999px;
  background: rgba(126, 231, 200, 0.18);
  box-shadow: 0 0 18px rgba(126, 231, 200, 0.18);
  transform: translate(-50%, -50%);
  transition: transform 90ms ease-out;
}

.prompt {
  margin-right: 0.75rem;
  color: var(--accent-strong);
}

#terminal-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #f4f4f5;
  font: inherit;
  outline: none;
}

#terminal-input::placeholder {
  color: #52525b;
}

.socials {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 20;
  display: flex;
  gap: 0.75rem;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 26, 36, 0.9);
  color: #d4d4d8;
  backdrop-filter: blur(12px);
  transition: border-color 120ms ease, color 120ms ease;
}

.socials a:hover {
  border-color: var(--accent);
  color: white;
}

.socials svg {
  width: 1.25rem;
  height: 1.25rem;
}

@media (min-width: 768px) {
  .page {
    padding: 2.5rem;
  }

  .shell {
    padding: 2rem;
  }

  .terminal-body {
    height: 32rem;
  }

  .app-controls {
    max-width: 10rem;
    margin: 0 auto;
  }

  .socials {
    right: 1.75rem;
    bottom: 1.75rem;
  }
}
