:root {
  --bg-color: #050510;
  --text-color: #e0e0e0;
  --primary-color: #6d28d9;
  /* Deep Purple */
  --accent-color: #06b6d4;
  /* Cyan */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --font-main: 'Outfit', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

[disabled] {
  pointer-events: none;
  opacity: 0.3;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow: hidden;
  /* Keep hidden for piano app context */
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
}

/* Background Effects */
.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary-color);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--accent-color);
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(30px, 50px);
  }
}

/* Typography */
h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

a,
a:link,
a:visited {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}


/* Piano Colors - Preserving original hues but making them fit */
.color-0 {
  background: #ee2b29;
  fill: #ee2b29;
}

.color-1 {
  background: #ff9800;
  fill: #ff9800;
}

.color-2 {
  background: #ffff00;
  fill: #ffff00;
}

.color-3 {
  background: #c6ff00;
  fill: #c6ff00;
}

.color-4 {
  background: #00e5ff;
  fill: #00e5ff;
}

.color-5 {
  background: #2979ff;
  fill: #2979ff;
}

.color-6 {
  background: #651fff;
  fill: #651fff;
}

.color-7 {
  background: #d500f9;
  fill: #d500f9;
}

.color-disabled {
  background: #d3d3d3;
  fill: #1c2c42;
}

/* AI Color */
.color-8 {
  background: #4caf50;
  fill: #4caf50;
}

canvas {
  position: absolute;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
}

#svg {
  position: absolute;
  top: 0;
  left: 0;
}

#svg rect {
  transition: all 0.2s linear;
}

/* Splash Screen */
.splash {
  font-size: 1.1rem;
  padding: 3rem;
  line-height: 1.6;
  width: 90%;
  max-width: 700px;
  margin: auto;
  text-align: center;
  border-radius: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  overflow: auto;
  max-height: 90vh;
}

.splash h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.splash-main b {
  color: var(--accent-color);
  font-weight: 600;
}

.splash p {
  margin-bottom: 1.5rem;
  color: #cbd5e1;
}

/* Buttons */
button.splash-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--primary-color), #4c1d95);
  color: white;
  text-decoration: none;
  padding: 1rem 2.5rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  margin: 2rem auto;
  width: auto;
  text-transform: none;
  letter-spacing: normal;
}

button.splash-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(109, 40, 217, 0.4);
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: white;
}

button.splash-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.splash-button.small {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

button.splash-button.small:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.05);
  color: #fff;
}

.splash-button.loading span {
  animation: pulsing-fade 1.2s ease-in-out infinite;
}

@keyframes pulsing-fade {
  50% {
    opacity: 0.3;
  }
}

.btn-green,
.btn-red,
.btn-blue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-decoration: none;
  margin: 0.5rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-green {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.btn-green:hover {
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-red {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.btn-red:hover {
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-blue {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.btn-blue:hover {
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* Controls (Piano Keys) */
.controls {
  display: flex;
  position: absolute;
  width: 90vw;
  max-width: 1000px;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  height: 120px;
  z-index: 2;
  gap: 4px;
}

.controls button {
  border: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  margin: 0;
  padding: 0;
  flex-grow: 1;
  height: 100%;
  width: 100%;
  transition: transform 0.1s linear, filter 0.2s;
  border-radius: 0 0 8px 8px;
  cursor: pointer;
}

.controls button:hover {
  filter: brightness(1.2);
}

.controls button[active] {
  transform: scale(0.95);
  filter: brightness(1.4);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) inset;
}


/* Dialogs */
.dialog {
  background: var(--glass-bg);
  color: var(--text-color);
  padding: 2rem;
  z-index: 10;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: left;
  overflow: auto;
}

.dialog h2 {
  color: var(--accent-color);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.dialog p {
  margin-bottom: 1.5rem;
}

.hint {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Radio Buttons */
.control-indicator {
  border: 2px solid var(--accent-color);
  border-radius: 4px;
  background: transparent;
}

label.radio {
  position: relative;
  display: inline-block;
  padding-left: 30px;
  margin-right: 20px;
  cursor: pointer;
  color: var(--text-color);
}

label.radio>input[type="radio"] {
  position: absolute;
  opacity: 0;
  z-index: -1;
}

label.radio>input:checked~.control-indicator {
  background-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
}

label.radio>.control-indicator {
  position: absolute;
  top: 2px;
  left: 0;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Inputs */
.dialog select,
.dialog input[type="number"] {
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  margin-bottom: 1rem;
  width: 100%;
  height: auto;
  transition: var(--transition);
}

.dialog input[type="number"]:focus {
  border-color: var(--accent-color);
  outline: none;
  background: rgba(255, 255, 255, 0.1);
}


/* Logos */
.splash-logo {
  max-width: 250px;
  width: 80%;
  height: auto;
  margin: 0 auto 2rem;
  display: block;
  filter: drop-shadow(0 0 20px rgba(109, 40, 217, 0.3));
}

.app-logo {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 120px;
  height: auto;
  z-index: 100;
  transition: var(--transition);
}

.app-logo:hover {
  filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.5));
}

.built-with {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.7;
  margin-top: 2rem;
}

/* Info container */
#info-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  overflow: hidden;
}

.info-text {
  font-size: 1.5rem;
  color: #fff;
  background: rgba(28, 44, 66, 0.8);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Responsive */
@media screen and (max-width: 700px) {
  .controls {
    height: 80px;
    width: 100vw;
    bottom: 0;
    gap: 1px;
    border-radius: 0;
  }

  .controls button {
    border-radius: 0;
  }

  canvas {
    top: 70px;
  }

  .splash {
    padding: 1.5rem;
    width: 95%;
  }

  h1,
  .splash h1 {
    font-size: 2rem;
  }
}

@media screen and (max-width: 500px) {
  body {
    font-size: 14px;
  }

  .app-logo {
    width: 100px;
    top: 15px;
    left: 15px;
  }

  .dialog {
    width: 95%;
    padding: 1.5rem;
  }

  button.splash-button {
    font-size: 1rem;
    padding: 0.8rem 2rem;
  }
}

.rotate-phone {
  display: none;
}

.phone-icon {
  position: relative;
  height: 60px;
  width: 60px;
  margin: 0 auto;
  fill: var(--text-color);
  animation: rotate 4s infinite ease-in-out;
}

@keyframes rotate {

  0%,
  10% {
    transform: rotate(0deg);
  }

  40%,
  60% {
    transform: rotate(-90deg);
  }

  95%,
  100% {
    transform: rotate(0deg);
  }
}