@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary: #006064;
  --secondary: #00838F;
  --accent: #0097A7;
  --light: #00BCD4;
  --bg: #E0F7FA;
  --white: #FFFAF7;
  --card-bg: #FFFFFF;
  --text: #3E2723;
  --text-light: #795548;
  --text-muted: #A1887F;
  --danger: #C62828;
  --success: #2E7D32;
  --warning: #F57F17;
  --shadow-sm: 0 1px 3px rgba(62, 39, 35, 0.08);
  --shadow-md: 0 4px 12px rgba(62, 39, 35, 0.1);
  --shadow-lg: 0 8px 24px rgba(62, 39, 35, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

::selection {
  background: var(--accent);
  color: var(--white);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== Loading Screen ===== */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
  color: var(--text-light);
  font-size: 1.1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== App Layout ===== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Header ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--primary);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.app-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.app-subtitle {
  font-size: 0.85rem;
  color: var(--light);
  font-weight: 300;
}

/* ===== Phase Navigation ===== */
.phase-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 2rem;
  background: var(--secondary);
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.phase-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  border: none;
  background: transparent;
  color: var(--light);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
  position: relative;
}

.phase-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.phase-btn.active {
  background: var(--bg);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.phase-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--bg);
}

/* ===== Timer ===== */
.timer-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.timer-container.low .timer-time {
  color: var(--warning);
  animation: pulse-warn 1s ease-in-out infinite;
}

.timer-container.expired .timer-time {
  color: var(--danger);
}

@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.timer-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
}

.timer-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s linear;
  border-radius: 0 2px 2px 0;
}

.timer-display {
  min-width: 60px;
  text-align: center;
}

.timer-time {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem;
  color: var(--bg);
  letter-spacing: 0.05em;
  transition: color 0.3s;
}

.timer-controls {
  display: flex;
  gap: 0.35rem;
}

.timer-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: 'DM Sans', sans-serif;
}

.timer-btn.start {
  background: var(--success);
  color: white;
}

.timer-btn.pause {
  background: var(--warning);
  color: white;
}

.timer-btn.reset {
  background: rgba(255, 255, 255, 0.2);
  color: var(--bg);
  font-size: 1rem;
}

.timer-btn:hover {
  transform: scale(1.1);
}

.timer-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

/* ===== Retro Board ===== */
.retro-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  animation: fadeIn 0.4s ease;
}

.retro-board.action-focus {
  grid-template-columns: 1fr;
  max-width: 600px;
  margin: 0 auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Column ===== */
.column {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.5s ease both;
}

.column:nth-child(1) { animation-delay: 0s; }
.column:nth-child(2) { animation-delay: 0.1s; }
.column:nth-child(3) { animation-delay: 0.2s; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.column-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--bg);
  background: linear-gradient(135deg, var(--bg) 0%, var(--white) 100%);
}

.column-emoji {
  font-size: 1.3rem;
}

.column-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--primary);
  flex: 1;
}

.column-count {
  background: var(--light);
  color: var(--secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

/* ===== Cards ===== */
.column-cards {
  flex: 1;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 200px;
  max-height: 60vh;
  overflow-y: auto;
}

.column-cards::-webkit-scrollbar {
  width: 4px;
}

.column-cards::-webkit-scrollbar-thumb {
  background: var(--light);
  border-radius: 4px;
}

.retro-card {
  background: var(--card-bg);
  border: 1px solid var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  transition: all 0.2s ease;
  animation: cardIn 0.35s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.retro-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
  word-wrap: break-word;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--bg);
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s ease;
}

.vote-btn:hover {
  background: var(--light);
  color: var(--secondary);
}

.vote-btn.voted {
  background: var(--primary);
  color: var(--bg);
}

.vote-btn.voted:hover {
  background: var(--secondary);
}

.vote-icon {
  font-size: 1rem;
  line-height: 1;
}

.vote-count {
  font-weight: 600;
  font-size: 0.8rem;
}

.card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* ===== Empty State ===== */
.empty-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

.empty-column p {
  font-size: 0.9rem;
}

.empty-hint {
  font-size: 0.8rem;
  font-weight: 300;
  margin-top: 0.25rem;
}

/* ===== Add Card ===== */
.add-card-btn {
  margin: 0.5rem 0.75rem 0.75rem;
  padding: 0.7rem;
  border: 2px dashed var(--light);
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.add-card-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(141, 110, 99, 0.05);
}

.add-card-form {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--light);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  resize: vertical;
  min-height: 70px;
  transition: border-color 0.2s;
  background: var(--white);
}

.card-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.15);
}

.card-input::placeholder {
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-submit {
  flex: 1;
  padding: 0.55rem;
  background: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-submit:hover:not(:disabled) {
  background: var(--secondary);
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-cancel {
  padding: 0.55rem 1rem;
  background: var(--bg);
  color: var(--text-light);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: var(--light);
}

/* ===== Skeleton Loading ===== */
.board-loading {
  padding: 0;
}

.skeleton-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.skeleton-column {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-header {
  height: 24px;
  width: 70%;
  background: var(--bg);
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-card {
  height: 80px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-card.short {
  height: 55px;
  width: 85%;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ===== Footer ===== */
.app-footer {
  padding: 0.75rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 300;
  border-top: 1px solid var(--light);
  background: var(--white);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .retro-board {
    grid-template-columns: 1fr;
  }

  .skeleton-board {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }

  .main-content {
    padding: 1rem;
  }

  .phase-nav {
    padding: 0.5rem 0.75rem;
    gap: 0.15rem;
  }

  .phase-btn {
    font-size: 0.82rem;
    padding: 0.6rem 0.5rem;
  }

  .column-cards {
    max-height: none;
  }
}

@media (max-width: 480px) {
  .app-title {
    font-size: 1.3rem;
  }

  .timer-time {
    font-size: 1.2rem;
  }

  .column-title {
    font-size: 0.95rem;
  }
}

/* ===== Focus Styles ===== */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to Retro Brew! This is your team's retrospective board with three columns: What Went Well, What Didn't Go Well, and Action Items.", "view": "default", "highlight_selector": ".retro-board", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Use the phase navigation to switch between Brainstorm, Discuss, and Action Items phases. Each phase has its own 5-minute timer.", "view": "default", "highlight_selector": ".phase-nav", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Start the countdown timer by pressing the play button. The timer syncs across all team members so everyone sees the same time.", "view": "default", "highlight_selector": ".timer-container", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Click '+ Add a card' to contribute your thoughts anonymously. Type your feedback and press Add Card.", "view": "default", "highlight_selector": ".add-card-btn", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Upvote cards you agree with by clicking the heart button. The most-voted cards float to the top of each column.", "view": "default", "highlight_selector": ".vote-btn", "wait_for": "user_interaction"},
  {"step": 6, "narration": "During the Action Items phase, the board focuses on just the action items column so the team can concentrate on next steps.", "view": "default", "highlight_selector": ".phase-btn:last-child", "wait_for": "tap_to_continue"}
]
-->

.auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.auth-title {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.auth-copy {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.auth-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.auth-button,
.signout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.auth-button {
  background: var(--primary);
  color: var(--bg);
}

.auth-button:hover,
.signout-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.signout-btn {
  background: rgba(255, 255, 255, 0.12);
  color: var(--bg);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.role-pill {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.role-pill.facilitator {
  background: var(--success);
  color: white;
}

.role-pill.viewer {
  background: var(--warning);
  color: white;
}

.role-banner {
  padding: 0.75rem 2rem;
  background: rgba(245, 127, 23, 0.12);
  color: var(--warning);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(245, 127, 23, 0.2);
}

.phase-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 900px) {
  .header-right {
    flex-wrap: wrap;
    justify-content: center;
  }

  .role-banner {
    padding: 0.75rem 1rem;
    text-align: center;
  }
}

.card-group {
  border: 1px solid rgba(141, 110, 99, 0.18);
  border-radius: var(--radius-md);
  background: rgba(239, 235, 233, 0.45);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed rgba(141, 110, 99, 0.2);
}

.card-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--secondary);
}

.card-group-count {
  background: var(--accent);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.card-group-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.card-group-item-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-group-item-wrap .retro-card {
  flex: 1;
}

.grouped-card {
  border-left-color: var(--success);
}

.ungroup-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.15rem;
  white-space: nowrap;
}

.ungroup-btn:hover {
  color: var(--danger);
}

.column.drag-over,
.card-group.drag-over {
  outline: 2px dashed rgba(141, 110, 99, 0.45);
  outline-offset: 2px;
}

.retro-card[draggable='true'] {
  cursor: grab;
}

.retro-card[draggable='true']:active {
  cursor: grabbing;
}

.retro-board {
  position: relative;
}

.presence-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
  padding: 0.35rem 0.5rem;
}

.presence-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.presence-avatars {
  display: flex;
  align-items: center;
}

.presence-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px;
  border: 2px solid var(--white);
  background: var(--accent);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
}

.presence-avatar:first-child {
  margin-left: 0;
}

.presence-avatar.me {
  background: var(--success);
}

.presence-more {
  background: var(--secondary);
}

@media (max-width: 900px) {
  .presence-strip {
    justify-content: center;
    margin-bottom: 0.5rem;
  }
}

.retro-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  animation: fadeIn 0.4s ease;
}

.retro-board.action-focus {
  grid-template-columns: 1fr;
  max-width: 600px;
  margin: 0 auto;
}

.retro-summary-panel {
  grid-column: 1 / -1;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.retro-summary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.retro-summary-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 400;
}

.retro-summary-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.retro-summary-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.summary-btn {
  white-space: nowrap;
}

.retro-summary-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.summary-section {
  background: rgba(239, 235, 233, 0.45);
  border: 1px solid rgba(141, 110, 99, 0.12);
  border-radius: var(--radius-md);
  padding: 0.9rem;
}

.summary-section h4 {
  font-size: 0.95rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.summary-section ul {
  padding-left: 1.1rem;
  color: var(--text);
}

.summary-section li + li {
  margin-top: 0.35rem;
}

.retro-summary-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.retro-summary-print {
  position: relative;
}

@media (max-width: 900px) {
  .retro-summary-header,
  .retro-summary-content {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .retro-summary-content {
    grid-template-columns: 1fr;
  }
}
