@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-main: #2d3436;
  --text-muted: #636e72;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --border: #dfe6e9;
  --accent: #0984e3;
  --accent-dark: #0767b0;
  --radius: 14px;
  --radius-sm: 10px;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text-main);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ===== Connect Screen ===== */

.connect-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px;
}

.connect-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 44px 28px 36px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 0 0 1px var(--border);
}

.connect-card__title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

.connect-card__subtitle {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.connect-card__input {
  width: 100%;
  padding: 16px 14px;
  font-size: 18px;
  font-family: var(--font-main);
  font-weight: 500;
  text-align: center;
  letter-spacing: 1.5px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
  margin-bottom: 16px;
}

.connect-card__input::placeholder {
  color: #b2bec3;
  letter-spacing: 0.5px;
  font-size: 15px;
}

.connect-card__input:focus {
  border-color: var(--accent);
}

.connect-card__input.error {
  border-color: #e74c3c;
}

.connect-card__btn {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-family: var(--font-main);
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}

.connect-card__btn:hover {
  background: var(--accent-dark);
}

.connect-card__btn:active {
  background: var(--accent-dark);
  transform: scale(0.98);
}

.connect-card__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.connect-card__error {
  margin: 14px 0 0;
  padding: 10px 14px;
  font-size: 13px;
  color: #c0392b;
  background: #fdecea;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

/* ===== Clicker Screen ===== */

.clicker-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Header */
.clicker-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.connection-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.connection-badge__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b2bec3;
  flex-shrink: 0;
}

.connection-badge.connected .connection-badge__dot {
  background: #00b894;
}

.connection-badge.disconnected .connection-badge__dot {
  background: #e74c3c;
}

.section-select {
  padding: 8px 28px 8px 12px;
  font-size: 14px;
  font-family: var(--font-main);
  font-weight: 500;
  color: var(--text-main);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%23636e72' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.section-select:focus {
  border-color: var(--accent);
}

/* Main content */
.clicker-main {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Up Next Card */
.up-next-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 16px 20px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.up-next-card__label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.up-next-card__name {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  word-break: break-word;
}

.up-next-card__count {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* Quality Buttons */
.quality-buttons {
  display: flex;
  gap: 8px;
}

.quality-btn {
  flex: 1;
  min-height: 56px;
  padding: 10px 6px;
  font-size: 14px;
  font-family: var(--font-main);
  font-weight: 600;
  color: #ffffff;
  background: var(--btn-color, var(--accent));
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
  line-height: 1.3;
  word-break: break-word;
}

.quality-btn:active {
  transform: scale(0.96);
  opacity: 0.9;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  flex: 1;
  min-height: 48px;
  padding: 10px 6px;
  font-size: 14px;
  font-family: var(--font-main);
  font-weight: 600;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
  color: var(--text-main);
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn--skip {
  color: #e17055;
  border-color: #fab1a0;
  background: #fff8f6;
}

.action-btn--complete {
  color: #00b894;
  border-color: #55efc4;
  background: #f0fff9;
}

.action-btn--undo {
  color: var(--text-muted);
  border-color: var(--border);
}

.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.action-btn:disabled:active {
  transform: none;
}

/* Recent Activity */
.recent-activity {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.recent-activity__header {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

.recent-activity__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-activity__item {
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

.recent-activity__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-activity__empty {
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}
