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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #ffffff;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Top-Left Controls: Selector + Beta status */
.top-left-controls {
  position: fixed;
  top: 24px;
  left: 28px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-group label {
  font-size: 13px;
  font-weight: 500;
  color: #666666;
  letter-spacing: -0.2px;
}

.control-group select {
  font-family: inherit;
  font-size: 13px;
  color: #111111;
  background-color: #ffffff;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  padding: 4px 26px 4px 10px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23333333' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.control-group select:hover {
  border-color: #000000;
  background-color: #fafafa;
}

.control-group select:focus {
  border-color: #000000;
}

.beta-badge {
  font-size: 11px;
  color: #777777;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid #e0e0e0;
  padding-left: 14px;
}

.logout-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 11px;
  color: #999999;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s ease;
}

.logout-link:hover {
  color: #d81605;
}

/* Top Half: White background with centered input */
.top-half {
  height: 50vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  position: relative;
}

.input-container {
  width: min(850px, 70vw);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

#noun-input {
  width: 100%;
  border: none;
  border-bottom: 2.5px solid #000000;
  outline: none;
  background: transparent;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.5px;
  text-align: center;
  color: #000000;
  padding: 8px 0 12px 0;
  caret-color: #000000;
  transition: border-bottom-color 0.2s ease;
}

#noun-input::selection {
  background-color: #aed5ff;
  color: #000000;
}

.input-container.loading #noun-input {
  border-bottom-color: #888888;
}

/* Toolbar above the bar chart */
.bar-toolbar {
  position: absolute;
  bottom: 16px;
  right: 28px;
  z-index: 20;
}

.toolbar-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #333333;
  background-color: #ffffff;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.toolbar-btn:hover {
  border-color: #000000;
  background-color: #f7f7f7;
  color: #000000;
}

.toolbar-btn:active {
  background-color: #eeeeee;
}

/* Bottom Half: Full-bleed Animated Bar Chart */
.bottom-half {
  height: 50vh;
  width: 100vw;
  position: relative;
  background-color: #ffffff;
  overflow: hidden;
}

.palette-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Fast, smooth spring-like transition (0.35s) */
.color-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease;
  will-change: left, width;
  cursor: pointer;
}

/* Minimal feedback toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #111111;
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 300;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
}

/* Closed Beta Gate Modal Overlay */
.beta-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.beta-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.beta-modal-card {
  width: min(420px, 90vw);
  background-color: #ffffff;
  border: 1.5px solid #000000;
  padding: 34px 30px;
  border-radius: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.07);
}

.beta-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  background-color: #000000;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 12px;
}

.beta-modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 8px;
  letter-spacing: -0.4px;
}

.beta-modal-header p {
  font-size: 13px;
  color: #666666;
  line-height: 1.5;
  margin-bottom: 22px;
}

.beta-form {
  display: flex;
  flex-direction: column;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-field label {
  font-size: 12px;
  font-weight: 500;
  color: #333333;
}

.form-field input {
  padding: 10px 12px;
  border: 1.5px solid #d5d5d5;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  color: #000000;
  outline: none;
  background-color: #ffffff;
  transition: border-color 0.15s ease;
}

.form-field input:focus {
  border-color: #000000;
}

#beta-code {
  letter-spacing: 4px;
  font-size: 17px;
  font-weight: 600;
}

.field-hint {
  font-size: 11px;
  color: #888888;
}

.beta-submit-btn {
  width: 100%;
  padding: 12px;
  background-color: #000000;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
  transition: background-color 0.15s ease;
}

.beta-submit-btn:hover {
  background-color: #262626;
}

.beta-error-box {
  padding: 10px 12px;
  background-color: #fff0f0;
  border: 1px solid #ffb3b3;
  color: #d81605;
  font-size: 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  line-height: 1.4;
}

@media (max-width: 768px) {
  #noun-input {
    font-size: 26px;
    padding-bottom: 8px;
  }
  .input-container {
    width: 85vw;
  }
  .top-left-controls {
    top: 16px;
    left: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .beta-badge {
    border-left: none;
    padding-left: 0;
  }
  .bar-toolbar {
    bottom: 12px;
    right: 16px;
  }
}
