.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.canvas-reset-button {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.canvas-reset-button:hover,
.canvas-reset-button:focus-visible {
  color: #ff6b81;
  background: rgba(255, 107, 129, 0.08);
  border-color: rgba(255, 107, 129, 0.35);
  transform: translateY(-1px);
}

.canvas-reset-button__icon {
  position: relative;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.canvas-reset-button__icon::before,
.canvas-reset-button__icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 999px;
}

.canvas-reset-button__icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.canvas-reset-button__icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.brand__mark {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 15px;
  box-shadow: 0 12px 32px rgba(124, 92, 255, 0.35);
}

.brand__text {
  display: grid;
  gap: 2px;
}

.brand__text span {
  color: var(--muted);
  font-size: 0.84rem;
}

.settings-panel {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.settings-panel__text {
  display: grid;
  gap: 4px;
}

.settings-panel__text span {
  color: var(--muted);
  font-size: 0.84rem;
}

.settings-panel--stack {
  display: grid;
  gap: 0;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.settings-panel__row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

.text-settings {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 320ms ease,
    opacity 280ms ease;
}

.text-settings__inner {
  min-height: 0;
  overflow: hidden;
  padding: 0 16px 16px;
  border-top: 1px solid transparent;
  transition: border-color 280ms ease;
}

.text-settings--open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.text-settings--open .text-settings__inner {
  padding-top: 16px;
  border-top-color: rgba(255, 255, 255, 0.06);
}

.text-settings__label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.text-settings__group {
  margin-top: 16px;
}

.text-settings__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.text-settings__value {
  color: var(--accent-2);
  font-size: 0.88rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.text-settings__range {
  width: 100%;
  height: 6px;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  outline: none;
}

.text-settings__range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  appearance: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.text-settings__hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.text-input-shell {
  position: relative;
  padding: 14px 14px 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.text-input-shell:focus-within {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 229, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.08);
}

.text-input {
  width: 100%;
  min-height: 34px;
  max-height: 132px;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  resize: none;
  background: transparent;
  border: 0;
  outline: none;
}

.text-input::placeholder {
  color: rgba(154, 166, 189, 0.72);
  font-weight: 600;
}

.text-input-shell__hint {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(154, 166, 189, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.align-toolbar,
.center-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.style-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.style-toggle__button {
  min-height: 44px;
  padding: 10px 12px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.style-toggle__button--active {
  color: var(--text);
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.38);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.08);
}

.center-text-button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid rgba(124, 92, 255, 0.34);
  border-radius: 14px;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.center-text-button:hover,
.center-text-button:focus-visible {
  background: rgba(124, 92, 255, 0.22);
}

.text-settings__row--color {
  margin-bottom: 0;
}

.text-settings__row--color .text-settings__label {
  margin-bottom: 0;
}

.color-input {
  width: 52px;
  height: 36px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-input::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}

.align-button,
.center-button {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 44px;
  padding: 8px 6px;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.align-button span[aria-hidden="true"],
.center-button span[aria-hidden="true"] {
  font-size: 1rem;
  line-height: 1;
}

.align-icon {
  display: grid;
  gap: 3px;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.align-icon::before,
.align-icon::after {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  content: "";
}

.align-icon--left::before {
  width: 72%;
}

.align-icon--left::after {
  width: 92%;
}

.align-icon--center::before,
.align-icon--center::after,
.align-icon--center {
  width: 100%;
}

.align-icon--right::before {
  width: 92%;
  margin-left: auto;
}

.align-icon--right::after {
  width: 72%;
  margin-left: auto;
}

.align-button--active,
.center-button:hover,
.center-button:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
}

.align-button--active {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.38);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.08);
}

.center-button--accent {
  background: rgba(124, 92, 255, 0.14);
  border-color: rgba(124, 92, 255, 0.34);
}

.center-button--accent:hover,
.center-button--accent:focus-visible {
  background: rgba(124, 92, 255, 0.22);
}

.phone__screen canvas.phone-canvas--dragging {
  cursor: grabbing;
}

.phone__screen canvas.phone-canvas--text-enabled:not(.phone-canvas--dragging) {
  cursor: grab;
}

.switch {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  border: 0;
}

.switch__track {
  position: relative;
  display: block;
  width: 58px;
  height: 34px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.switch__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  transition: transform 180ms ease;
}

.switch[aria-pressed="true"] .switch__track {
  background: rgba(0, 229, 255, 0.22);
  border-color: rgba(0, 229, 255, 0.55);
}

.switch[aria-pressed="true"] .switch__thumb {
  transform: translateX(24px);
}

.game-menu {
  display: grid;
  gap: 12px;
}

.game-button {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding: 14px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.game-button:hover,
.game-button:focus-visible,
.game-button--active {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.game-button__index {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-2);
  background: rgba(0, 229, 255, 0.1);
  border-radius: 12px;
}

.game-button__content {
  display: grid;
  gap: 4px;
}

.game-button__content small {
  color: var(--muted);
}

.record-panel {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.record-button {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
}

.record-button__dot {
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(255, 71, 126, 0.12);
}

.record-button[data-recording="true"] {
  background: rgba(255, 71, 126, 0.16);
  border-color: rgba(255, 71, 126, 0.38);
}

.record-button[data-recording="true"] .record-button__dot {
  animation: recordPulse 1s ease-in-out infinite;
}

.record-timer {
  justify-self: center;
  color: var(--muted-strong);
  font-variant-numeric: tabular-nums;
}

@keyframes recordPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.35);
    opacity: 0.72;
  }
}

.phone {
  position: relative;
  isolation: isolate;
}

.phone__body {
  position: relative;
  padding: clamp(10px, 1.7vh, 18px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 18%),
    linear-gradient(315deg, rgba(0, 0, 0, 0.76), transparent 36%),
    linear-gradient(135deg, #30384f, #0a0d17 45%, #2a3046);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: clamp(34px, 5.2vh, 58px);
  box-shadow:
    0 42px 110px rgba(0, 0, 0, 0.58),
    0 0 70px rgba(124, 92, 255, 0.18),
    inset 0 0 0 2px rgba(255, 255, 255, 0.06),
    inset 0 -18px 34px rgba(0, 0, 0, 0.38);
}

.phone__body::before {
  position: absolute;
  inset: 8px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: clamp(28px, 4.6vh, 50px);
}

.phone__screen {
  position: relative;
  width: min(44vh, calc(100vw - 340px - 360px - 48px));
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: clamp(26px, 4.2vh, 44px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.phone__screen canvas {
  width: 100%;
  height: 100%;
}

.phone__side {
  position: absolute;
  z-index: -1;
  width: 5px;
  background: linear-gradient(180deg, #4b536c, #171b29 55%, #05070d);
  border-radius: 999px;
}

.phone__side--left {
  top: 18%;
  left: -3px;
  height: 14%;
}

.phone__side--right {
  top: 26%;
  right: -3px;
  height: 20%;
}
