:root {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, #0f1f2d, #050910);
  color: #f5f7fb;
  height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.panel-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0.75rem;
}

.global-actions {
  width: min(520px, 100%);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card {
  width: min(520px, 100%);
  background: rgba(8, 15, 30, 0.85);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.card h1 {
  margin-top: 0;
}

label {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.4rem;
}

input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(9, 15, 27, 0.9);
  color: inherit;
  margin-bottom: 1rem;
}

button {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.2s ease;
}

button.primary {
  background: linear-gradient(120deg, #22d3ee, #2563eb);
  color: #050910;
  box-shadow: 0 10px 25px rgba(34, 211, 238, 0.35);
}

.panel-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.panel-toolbar .primary {
  flex: 1 1 200px;
  text-align: center;
}

button.primary:active {
  transform: translateY(2px);
  box-shadow: 0 6px 15px rgba(34, 211, 238, 0.25);
}

button.ghost {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hidden {
  display: none !important;
}

header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.spacer {
  flex: 1;
}

.words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.word {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.word button.toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  background: #611;
  color: #fff;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 8px 0 #2b0404, 0 10px 15px rgba(0, 0, 0, 0.4);
  border-radius: 1.2rem;
  padding: 0.9rem 1.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.word-name {
  font-size: 1rem;
}

.word-state {
  font-size: 0.7rem;
  opacity: 0.8;
}

.word button.toggle.on {
  background: #0f6;
  color: #011;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 8px 0 #0a6c2d, 0 10px 20px rgba(0, 255, 107, 0.25);
}

.word button.toggle:active {
  transform: translateY(4px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 0 rgba(0, 0, 0, 0.4);
}

.word button.remove {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.error {
  color: #f87171;
  min-height: 1.2rem;
}

.info {
  color: #a5f3fc;
  min-height: 1.2rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.modal-content {
  background: #101828;
  padding: 2rem;
  border-radius: 1rem;
  width: min(380px, 90%);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .words {
    justify-content: center;
  }
}
