@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@500;700&display=swap');

:root {
  /* Palette from Image */
  --bg-color: #fffaf0;
  /* Cream/Off-white */
  --ink-color: #547c98;
  /* Muted Blue/Slate - The distinct border color */
  --accent-color: #fceea7;
  /* Pastel Yellow - Logic button */
  --text-color: #547c98;
  /* Use Ink color for text too for consistency */
  --white: #ffffff;

  /* Dimensions/Borders */
  --border-width: 3px;
  --border-radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Zen Maru Gothic', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overscroll-behavior-y: none;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  max-width: 600px;
  /* Force mobile width feeling on desktop */
  margin: 0 auto;
  /* Center on desktop */
  background: var(--bg-color);
  border-left: 2px solid #eee;
  /* Visual boundary on desktop */
  border-right: 2px solid #eee;
}

.router-view {
  flex: 1;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* View Container - Centering content */
.view-content {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Date Header */
.date-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.clickable-date {
  font-size: 2rem;
  /* Large date like image */
  font-weight: 700;
  cursor: pointer;
  margin: 0;
  letter-spacing: 0.05em;
  color: var(--text-color);
}

.nav-arrow {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.nav-arrow:hover {
  opacity: 1;
}

/* Mood Selector - 3 Circles */
.mood-selector {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 8px;
  /* Space before bubble */
}

.mood-selector label {
  cursor: pointer;
}

.mood-selector input {
  display: none;
}

.mood-circle {
  width: 60px;
  height: 60px;
  border: var(--border-width) solid var(--ink-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: transparent;
  transition: transform 0.2s, background 0.2s;
}

.mood-selector input:checked+.mood-circle {
  background: var(--ink-color);
  color: var(--white);
  transform: scale(1.1);
}

/* Speech Bubble Diary Area */
.diary-container {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.speech-bubble {
  position: relative;
  background: var(--bg-color);
  /* Transparent/match bg? Image has white bg inside bubble maybe? let's stick to simple border first */
  border: var(--border-width) solid var(--ink-color);
  border-radius: 30px;
  padding: 24px;
  width: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

/* The little tail */
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -18px;
  /* Position below */
  left: 40px;
  /* Left aligned tail */
  border-width: 20px 20px 0;
  border-style: solid;
  border-color: var(--ink-color) transparent;
  display: block;
  width: 0;
}

/* Inner tail to mask border and make it look outlined? 
   CSS Triangles are filled. To make an outlined speech bubble tail is tricky.
   Simpler approach: Sketchy bubble SVG background would be best, but sticking to CSS:
   We will just use the bubble shape for now.
*/

/* Textarea inside bubble */
.diary-content {
  width: 100%;
  min-height: 150px;
  max-height: 500px;
  border: none;
  resize: none;
  /* Disable default resize handle */
  background: transparent;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 1.2rem;
  color: var(--text-color);
  outline: none;
  line-height: 1.8;
  overflow-y: auto;
}

.diary-content::placeholder {
  color: rgba(84, 124, 152, 0.5);
}

/* AI Summary Button */
.ai-button {
  background: var(--accent-color);
  border: var(--border-width) solid var(--ink-color);
  border-radius: 30px;
  padding: 12px 48px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  margin-top: 32px;
  /* Space for tail */
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--ink-color);
  /* Simple shadow */
  transition: transform 0.1s, box-shadow 0.1s;
}

.ai-button:active {
  transform: translateY(2px);
  box-shadow: 0px 0px 0px var(--ink-color);
}

/* Save Status text */
.save-status {
  margin-top: 8px;
  font-size: 0.9rem;
  height: 1.5em;
  /* reserve space */
  color: var(--ink-color);
}

/* Bottom Nav - minimal */
.bottom-nav {
  /* height: 0; Hidden if we follow image strictly? 
     User said "I want to unify UI design LIKE the image".
     The image is a single screen. Assuming we still need nav.
     Let's style nav to match.
  */
  height: 60px;
  background: var(--bg-color);
  border-top: var(--border-width) solid var(--ink-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.nav-item {
  text-decoration: none;
  color: var(--text-color);
  opacity: 0.5;
  font-size: 1.5rem;
}

.nav-item.active {
  opacity: 1;
  transform: scale(1.1);
}

/* Calendar Modal - match style */
.calendar-modal {
  border: var(--border-width) solid var(--ink-color);
  border-radius: 30px;
  background: var(--bg-color);
  color: var(--text-color);
  padding: 0;
  width: 320px;
  max-width: 90vw;
  box-shadow: 4px 4px 0px rgba(84, 124, 152, 0.2);
}

.calendar-modal::backdrop {
  background: rgba(84, 124, 152, 0.3);
  backdrop-filter: blur(2px);
}

.calendar-container {
  padding: 20px;
  background: var(--bg-color);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-header span {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
}

.calendar-header button {
  background: white;
  border: 2px solid var(--ink-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-color);
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 2px 2px 0px rgba(84, 124, 152, 0.1);
}

.calendar-header button:active {
  transform: translateY(1px);
  box-shadow: none;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 500;
}

.calendar-day:hover {
  background: rgba(84, 124, 152, 0.1);
}

.calendar-day.today {
  border: 2px solid var(--ink-color);
  color: var(--ink-color);
  font-weight: 700;
}

.calendar-day.selected {
  background: var(--ink-color);
  color: var(--white);
  font-weight: 700;
}

.calendar-day.other-month {
  color: #cadbdc;
}

.calendar-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.calendar-footer button {
  background: transparent;
  border: 2px solid var(--ink-color);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--ink-color);
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.calendar-footer button#cal-today {
  background: var(--accent-color);
  border: 2px solid var(--ink-color);
}

/* List View */
.list-view {
  padding: 20px;
}

.list-header {
  margin-bottom: 24px;
  text-align: center;
}

.list-header h2 {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 16px;
  font-weight: 700;
}

.search-box input {
  width: 100%;
  padding: 12px 20px;
  border: var(--border-width) solid var(--ink-color);
  border-radius: 30px;
  font-size: 1.1rem;
  font-family: 'Zen Maru Gothic', sans-serif;
  color: var(--text-color);
  background: white;
  outline: none;
  box-shadow: 2px 2px 0px rgba(84, 124, 152, 0.1);
  transition: box-shadow 0.2s;
}

.search-box input:focus {
  box-shadow: 4px 4px 0px rgba(84, 124, 152, 0.2);
}

.search-box input::placeholder {
  color: rgba(84, 124, 152, 0.5);
}

.entry-item {
  background: #ffffff;
  border: 2px solid var(--ink-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 6px 6px 0px rgba(84, 124, 152, 0.2);
}

.summary-modal::backdrop {
  background: rgba(84, 124, 152, 0.4);
  backdrop-filter: blur(2px);
}

.summary-container {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-header h3 {
  margin: 0;
  font-size: 1.5rem;
  text-align: center;
  font-weight: 700;
  color: var(--ink-color);
}

.summary-text-box {
  background: white;
  border: 2px solid var(--ink-color);
  border-radius: 16px;
  padding: 16px;
  font-size: 1.1rem;
  line-height: 1.6;
  min-height: 100px;
  max-height: 300px;
  overflow-y: auto;
}

.summary-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.action-btn {
  background: var(--accent-color);
  border: 2px solid var(--ink-color);
  border-radius: 20px;
  padding: 10px 24px;
  color: var(--ink-color);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--ink-color);
  transition: transform 0.1s;
}

.action-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* AI Loading Toast (Non-blocking) */
.ai-loading-toast {
  position: fixed;
  bottom: 80px;
  /* Above nav */
  right: 20px;
  background: white;
  border: 2px solid var(--ink-color);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-width: 300px;
  font-size: 0.9rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.spinner-small {
  width: 20px;
  height: 20px;
  border: 3px solid var(--ink-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.ai-status-text {
  color: var(--ink-color);
  font-weight: bold;
}

.progress-bar-small {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  width: 100%;
  margin-top: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--ink-color);
  width: 0%;
  transition: width 0.3s;
}

/* --- Opening / Splash View --- */
.center-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
  background-color: var(--bg-color);
}

.opening-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  animation: fadeIn 1s ease-out;
}

.app-title {
  font-size: 3rem;
  color: var(--ink-color);
  margin: 0;
  letter-spacing: 0.1em;
}

.app-subtitle {
  font-size: 1.2rem;
  color: var(--text-color);
  opacity: 0.8;
  line-height: 1.6;
}

.illustration-placeholder {
  font-size: 5rem;
  margin: 20px 0;
  animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }

}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.primary-btn-large {
  background: var(--ink-color);
  color: var(--white);
  border: none;
  border-radius: 30px;
  padding: 16px 64px;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(84, 124, 152, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Zen Maru Gothic', sans-serif;
}

.primary-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(84, 124, 152, 0.4);
}

.primary-btn-large:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(84, 124, 152, 0.3);
}

/* --- Terms View --- */
.terms-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
}

.terms-header {
  text-align: center;
  margin-bottom: 24px;
}

.terms-header h2 {
  color: var(--ink-color);
  font-size: 1.5rem;
}

.terms-content {
  flex: 1;
  overflow-y: auto;
  background: white;
  border: 2px solid var(--ink-color);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
}

.terms-text p {
  line-height: 1.6;
  margin-bottom: 16px;
}

.terms-text h3 {
  color: var(--ink-color);
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 8px;
  border-bottom: 1px dotted var(--ink-color);
  padding-bottom: 4px;
}

.terms-footer {
  display: flex;
  justify-content: center;
  padding-bottom: 20px;
}

.inline-link {
  color: var(--accent-color);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.inline-link:hover {
  color: var(--ink-color);
}

/* --- Shared Button Styles --- */
.secondary-btn {
  background: var(--white);
  color: var(--ink-color);
  border: 2px solid var(--ink-color);
  border-radius: 24px;
  padding: 12px 48px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Zen Maru Gothic', sans-serif;
}

.secondary-btn:hover {
  background: var(--ink-color);
  color: var(--white);
}

.secondary-btn:active {
  transform: scale(0.98);
}

/* --- Privacy Policy Page --- */
.privacy-view {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.privacy-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink-color);
}

.privacy-header h2 {
  color: var(--ink-color);
  font-size: 1.8rem;
  margin: 0;
}

.privacy-content {
  background: var(--white);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.privacy-text p,
.privacy-text li {
  line-height: 1.6;
  margin-bottom: 12px;
}

.privacy-text h3 {
  color: var(--ink-color);
  font-size: 1.2rem;
  margin-top: 28px;
  margin-bottom: 12px;
  border-bottom: 2px dotted var(--ink-color);
  padding-bottom: 6px;
}

.privacy-text h4 {
  color: var(--text-color);
  font-size: 1.05rem;
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 600;
}

.privacy-text ul,
.privacy-text ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.privacy-text li {
  margin-bottom: 8px;
}

.privacy-footer {
  display: flex;
  justify-content: center;
  padding: 20px;
  margin-top: 24px;
}

/* --- App Header --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--bg-color);
  border-bottom: 2px solid #eee;
  /* Subtle separation */
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  /* border: 2px solid var(--ink-color); */
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-color);
}

.header-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn:hover {
  background: rgba(84, 124, 152, 0.1);
}

.settings-icon {
  width: 24px;
  height: 24px;
  color: var(--ink-color);
  transition: all 0.3s ease;
}

.header-btn:hover .settings-icon {
  color: var(--accent-color);
  transform: rotate(30deg);
}

.header-btn:active .settings-icon {
  transform: rotate(60deg) scale(0.95);
}

/* --- Settings Modal --- */
.settings-modal {
  border: var(--border-width) solid var(--ink-color);
  border-radius: 20px;
  background: var(--bg-color);
  color: var(--text-color);
  padding: 0;
  width: 320px;
  max-width: 90vw;
  box-shadow: 4px 4px 0px rgba(84, 124, 152, 0.2);
}

.settings-modal::backdrop {
  background: rgba(84, 124, 152, 0.3);
  backdrop-filter: blur(2px);
}

.settings-container {
  padding: 20px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.settings-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--ink-color);
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--ink-color);
  cursor: pointer;
  line-height: 1;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 700;
  padding: 12px;
  background: white;
  border: 2px solid var(--ink-color);
  border-radius: 12px;
  transition: transform 0.1s;
}

.settings-link-item:active {
  transform: scale(0.98);
}

.settings-item-stub {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f0f0f0;
  border: 2px solid #ccc;
  border-radius: 12px;
  color: #999;
}

/* --- Inline Summary Result --- */
.summary-result {
  margin-top: 24px;
  padding: 20px;
  background: #fff;
  border: 2px solid var(--ink-color);
  border-radius: 20px;
  animation: fadeIn 0.3s ease-out;
}

.summary-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--ink-color);
  font-size: 1.1rem;
}

.copy-btn-small {
  background: var(--accent-color);
  border: 2px solid var(--ink-color);
  border-radius: 12px;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-color);
  cursor: pointer;
  transition: transform 0.1s;
}

.copy-btn-small:active {
  transform: scale(0.95);
}

.summary-text-inline {
  width: 100%;
  min-height: 100px;
  max-height: 300px;
  padding: 12px;
  border: 2px solid var(--ink-color);
  border-radius: 12px;
  background: #fff;
  font-family: 'Zen Maru Gothic', sans-serif;
  line-height: 1.8;
  color: var(--text-color);
  font-size: 1.1rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  resize: vertical;
  outline: none;
}

.summary-text-inline:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(255, 182, 193, 0.3);
}

.summary-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  padding: 0 4px;
}

.char-count {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.char-count.over-limit {
  color: #d32f2f;
  font-weight: 700;
}

.summary-notice {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fff9e6;
  border: 2px solid #ffd54f;
  border-radius: 12px;
}

.summary-notice p {
  margin: 6px 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-color);
}

.summary-notice p:first-child {
  font-weight: 600;
}

.summary-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: flex-end;
}

.share-btn {
  background: #1da1f2;
  color: white;
  border: 2px solid var(--ink-color);
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Zen Maru Gothic', sans-serif;
}

.share-btn:hover {
  background: #1a8cd8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(29, 161, 242, 0.3);
}

.share-btn:active {
  transform: translateY(0);
}

/* --- Tutorial Overlay --- */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  pointer-events: all;
}

.tutorial-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.3s ease-out;
}

.tutorial-tooltip {
  position: absolute;
  background: var(--white);
  border: 3px solid var(--ink-color);
  border-radius: 20px;
  padding: 24px;
  max-width: 350px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  animation: bounceIn 0.4s ease-out;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }

  60% {
    opacity: 1;
    transform: scale(1.05) translateY(-5px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tutorial-content {
  margin-bottom: 20px;
}

.tutorial-text {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-color);
  margin: 0 0 16px 0;
  font-weight: 500;
}

.tutorial-progress {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  font-weight: 600;
}

.tutorial-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.tutorial-btn-skip,
.tutorial-btn-next {
  padding: 10px 24px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Zen Maru Gothic', sans-serif;
  border: 2px solid var(--ink-color);
}

.tutorial-btn-skip {
  background: var(--white);
  color: var(--ink-color);
}

.tutorial-btn-skip:hover {
  background: #f5f5f5;
}

.tutorial-btn-next {
  background: var(--ink-color);
  color: var(--white);
}

.tutorial-btn-next:hover {
  background: #3d5a6d;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(84, 124, 152, 0.3);
}

.tutorial-btn-skip:active,
.tutorial-btn-next:active {
  transform: scale(0.95);
}

/* Tutorial highlight effect */
.tutorial-highlight {
  position: relative;
  z-index: 9999 !important;
  box-shadow: 0 0 0 4px var(--accent-color), 0 0 0 8px rgba(255, 182, 193, 0.3) !important;
  border-radius: 12px !important;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 4px var(--accent-color), 0 0 0 8px rgba(255, 182, 193, 0.3);
  }

  50% {
    box-shadow: 0 0 0 4px var(--accent-color), 0 0 0 12px rgba(255, 182, 193, 0.5);
  }
}

/* --- PWA Install Banner --- */
.install-banner {
  position: fixed;
  bottom: 70px;
  /* Above bottom nav */
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 500px;
  background: var(--white);
  border: var(--border-width) solid var(--ink-color);
  border-radius: 20px;
  box-shadow: 4px 4px 0px rgba(84, 124, 152, 0.3);
  z-index: 999;
  animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }

  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.install-banner-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
  min-width: 0;
}

.install-banner-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink-color);
  margin-bottom: 2px;
}

.install-banner-subtitle {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.8;
}

.install-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.install-btn-primary {
  background: var(--ink-color);
  color: var(--white);
  border: 2px solid var(--ink-color);
  border-radius: 16px;
  padding: 8px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Zen Maru Gothic', sans-serif;
  transition: all 0.2s;
  box-shadow: 2px 2px 0px rgba(84, 124, 152, 0.2);
}

.install-btn-primary:hover {
  background: #3d5a6d;
  transform: translateY(-2px);
  box-shadow: 3px 3px 0px rgba(84, 124, 152, 0.3);
}

.install-btn-primary:active {
  transform: translateY(0);
  box-shadow: 1px 1px 0px rgba(84, 124, 152, 0.2);
}

.install-btn-secondary {
  background: transparent;
  color: var(--ink-color);
  border: 2px solid var(--ink-color);
  border-radius: 16px;
  padding: 8px 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Zen Maru Gothic', sans-serif;
  transition: all 0.2s;
}

.install-btn-secondary:hover {
  background: rgba(84, 124, 152, 0.1);
}

.install-btn-secondary:active {
  transform: scale(0.95);
}

/* Responsive adjustments for install banner */
@media (max-width: 480px) {
  .install-banner {
    bottom: 65px;
    width: calc(100% - 16px);
  }

  .install-banner-content {
    padding: 12px;
    gap: 8px;
  }

  .install-banner-icon {
    font-size: 1.5rem;
  }

  .install-banner-title {
    font-size: 1rem;
  }

  .install-banner-subtitle {
    font-size: 0.85rem;
  }

  .install-btn-primary,
  .install-btn-secondary {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
}

/* --- Opening Links --- */
.opening-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  font-size: 0.95rem;
  margin-top: 24px;
}

.text-link {
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.text-link:hover {
  border-bottom-color: var(--text-color);
}

.separator {
  color: var(--text-color);
  opacity: 0.5;
}