
.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.header__brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header__logo {
  font-size: 1.125rem;
  font-weight: 700;
  background: var(--gradient-logo);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}

.header__tagline {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl) var(--space-md);
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.view {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: var(--space-lg);
}

.view.is-active {
  display: flex;
}

.start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-2xl) var(--space-lg) var(--space-lg);
  text-align: center;
  width: 100%;
}

.start-screen__badge {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text);
}

.start-screen__caption {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-top: calc(-1 * var(--space-md));
}

.btn--start {
  font-size: 1.125rem;
  padding: 0.875rem 3.5rem;
  letter-spacing: 0.03em;
}

.start-screen__keys {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.start-screen__keys-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.start-screen__key-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm) var(--space-xl);
}

.start-screen__key-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.key-badges {
  display: flex;
  gap: 3px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.625rem;
  padding: 0.2rem 0.4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  box-shadow: 0 1px 0 var(--color-border);
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.header__exit {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 2px 0;
  display: block;
  transition: color 0.15s;
}
.header__exit:hover { color: var(--color-accent); }

.header__logo--deck {
  font-size: 0.9375rem;
  font-weight: 700;
  -webkit-text-fill-color: unset;
  background: none;
  color: var(--color-text);
}

.gesture-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  letter-spacing: 0.01em;
  opacity: 0.75;
  margin-top: calc(var(--space-sm) * -0.5);
}

.header--study {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  border-bottom: none;
}

.header--study .study-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0;
}

.header__col--left  { justify-self: start; }
.header__col--center { justify-self: center; text-align: center; line-height: 1.35; }
.header__col--right { justify-self: end; display: flex; align-items: center; gap: 0.5rem; }

.header__deck-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.study-deck-flag {
  display: inline-block;
  width: 26px;
  height: 19px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  overflow: hidden;
}

.header--study .round-counter {
  margin: 0;
  font-size: 0.75rem;
}

.study-bar {
  height: 3px;
  background: rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.study-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--deck-color, var(--color-accent)), var(--deck-color-dark, var(--color-accent)));
  width: 0%;
  transition: width 0.35s ease;
}
