:root {
  --primary: #ff6b6b;
  --secondary: #4ecdc4;
  --yellow: #ffe66d;
  --bg-gradient: linear-gradient(135deg, #a8edd9 0%, #fed6e3 100%);
  --paper-bg: #fffdf9;
  --text-color: #2d3436;
  --line-color: rgba(78, 205, 196, 0.3);
  --shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

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

body {
  font-family: 'Zen Maru Gothic', sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  color: var(--text-color);
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.diary-app {
  width: 100%;
  max-width: 850px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  padding: 15px 25px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title h1 {
  font-size: 1.8rem;
  color: #ff5252;
  text-shadow: 1px 1px 0 #fff;
}

.icon {
  font-size: 1.8rem;
}

.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-action {
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
  transition: all 0.2s ease;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.5);
}

.btn-gacha-action {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
  transition: all 0.2s;
}

.btn-gacha-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.5);
}

.badge-pill {
  background: #ffe66d;
  color: #2d3436;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.btn-secondary-action {
  background: #f1f2f6;
  color: #2f3542;
  border: 1px solid #ced6e0;
  padding: 10px 14px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover {
  background: #dfe4ea;
  transform: translateY(-1px);
}

/* Date Navigator Bar */
.date-navigator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.nav-btn {
  background: #f1f2f6;
  color: #2f3542;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  background: var(--secondary);
  color: white;
  transform: scale(1.05);
}

.current-date-box {
  position: relative;
  cursor: pointer;
}

.date-text {
  font-size: 1.5rem;
  font-weight: 900;
  color: #2f3542;
  background: #ffe66d;
  padding: 6px 20px;
  border-radius: 20px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

.date-picker-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Notebook Container */
.notebook-wrapper {
  position: relative;
  perspective: 1200px;
}

.notebook-page {
  background: var(--paper-bg);
  min-height: 480px;
  border-radius: 20px;
  padding: 40px 45px 30px 65px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  border: 1px solid #eaeaea;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

/* Notebook Margin & Lines */
.notebook-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 45px;
  bottom: 0;
  width: 2px;
  background: #ff7675;
  opacity: 0.6;
}

.page-header {
  border-bottom: 2px dashed #4ecdc4;
  padding-bottom: 15px;
  margin-bottom: 25px;
}

.page-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.badge {
  font-size: 0.9rem;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 700;
}

.weather-badge {
  background: #eccc68;
  color: #2f3542;
}

.tag-badge {
  background: #70a1ff;
  color: white;
}

.entry-title {
  font-size: 1.8rem;
  color: #2ed573;
  text-shadow: 1px 1px 0 #fff;
}

.entry-body {
  font-size: 1.3rem;
  line-height: 2.2;
  color: #2f3542;
  white-space: pre-wrap;
  min-height: 200px;
  /* Notebook Lines Effect */
  background-image: linear-gradient(transparent 95%, var(--line-color) 100%);
  background-size: 100% 2.2em;
  margin-bottom: 25px;
}

/* AI Warm Response Box */
.ai-response-box {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 2px solid #818cf8;
  border-radius: 18px;
  padding: 16px 20px;
  display: flex;
  gap: 15px;
  align-items: flex-start;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
  margin-top: 15px;
}

.ai-avatar {
  font-size: 2.2rem;
  background: #ffffff;
  padding: 6px;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.ai-message-content {
  flex: 1;
}

.ai-header-name {
  font-size: 0.95rem;
  font-weight: 900;
  color: #4f46e5;
  margin-bottom: 6px;
}

.ai-comment-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #1e1b4b;
  font-weight: 700;
}

.page-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn-small {
  background: #f1f2f6;
  border: 1px solid #ced6e0;
  padding: 6px 15px;
  border-radius: 15px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small:hover {
  background: #dfe4ea;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: white;
  width: 92%;
  max-width: 600px;
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card.wide {
  max-width: 850px;
}

.collection-sub {
  font-size: 1rem;
  color: #636e72;
  margin-bottom: 20px;
  font-weight: 700;
}

/* Game Card Collection Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 10px 5px;
}

/* High Quality Cool Game Trading Card Item */
.game-card-item {
  background: linear-gradient(145deg, #1e272e, #0f171e);
  border-radius: 16px;
  border: 2px solid #e1b12c;
  padding: 12px;
  color: white;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-card-item:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 15px 35px rgba(225, 177, 44, 0.4);
}

.game-card-item.locked {
  filter: grayscale(1) brightness(0.3);
  border-color: #485460;
  cursor: not-allowed;
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fbc531;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.card-rarity {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 900;
}

.rarity-ssr {
  background: linear-gradient(135deg, #ff007f, #7928ca);
  color: #fff;
  box-shadow: 0 0 12px #ff007f;
}

.rarity-sr {
  background: linear-gradient(135deg, #f39c12, #f1c40f);
  color: #000;
}

.rarity-r {
  background: linear-gradient(135deg, #0984e3, #74b9ff);
  color: white;
}

.rarity-n {
  background: linear-gradient(135deg, #636e72, #b2bec3);
  color: #2d3436;
}

.card-image-box {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.card-desc {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #dcdde1;
}

.card-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 900;
  background: rgba(255,255,255,0.1);
  padding: 4px 8px;
  border-radius: 6px;
}

/* Fullscreen Gacha Animation */
.gacha-anim-container {
  text-align: center;
  color: white;
}

.gacha-machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.gacha-capsule {
  font-size: 7rem;
  animation: gachaSpin 0.6s infinite linear;
  filter: drop-shadow(0 0 20px #ffe66d);
}

@keyframes gachaSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

.gacha-text-status {
  font-size: 1.8rem;
  font-weight: 900;
  color: #ffe66d;
  text-shadow: 0 0 10px #ffe66d;
  animation: pulse 0.5s infinite alternate;
}

/* Reward Popup */
.reward-card-pop {
  background: linear-gradient(135deg, #111, #1a1a2e);
  padding: 30px;
  border-radius: 24px;
  border: 3px solid #fbc531;
  text-align: center;
  color: white;
  box-shadow: 0 0 50px rgba(251, 197, 49, 0.7);
  max-width: 380px;
  animation: rewardPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gacha-sparkles {
  font-size: 2rem;
  animation: pulse 0.8s infinite alternate;
}

@keyframes rewardPop {
  0% { transform: scale(0.2); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.reward-title {
  color: #fbc531;
  font-size: 1.6rem;
  margin-bottom: 20px;
  text-shadow: 0 0 15px #fbc531;
}

.margin-top-20 {
  margin-top: 20px;
}

/* Windows Win+H Banner */
.win-h-banner {
  background: linear-gradient(135deg, #0984e3, #6c5ce7);
  color: white;
  padding: 12px 18px;
  border-radius: 14px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
  transition: transform 0.2s;
}

.win-h-banner.flash {
  animation: bannerFlash 0.6s ease;
}

@keyframes bannerFlash {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); background: linear-gradient(135deg, #ff4757, #ff6b81); }
  100% { transform: scale(1); }
}

.banner-icon {
  font-size: 1.6rem;
}

.banner-text strong {
  background: #ffe66d;
  color: #2d3436;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 1.1rem;
}

.form-group-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.flex-1 {
  flex: 1;
}

.form-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-with-mic {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-with-mic label {
  font-weight: 700;
  font-size: 1rem;
}

.btn-win-h {
  background: #00cec9;
  color: #2d3436;
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-win-h.highlight {
  background: linear-gradient(135deg, #ffe66d, #fdcb6e);
  box-shadow: 0 3px 8px rgba(253, 203, 110, 0.4);
}

.btn-win-h:hover {
  transform: scale(1.04);
}

.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px;
  border: 2px solid #eccc68;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.05rem;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: #0984e3;
  outline: none;
  box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.2);
}

.form-group textarea {
  resize: vertical;
}

.btn-primary {
  background: var(--secondary);
  color: white;
  border: none;
  width: 100%;
  padding: 12px;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.btn-gacha-trigger {
  background: linear-gradient(135deg, #ff007f, #7928ca);
  box-shadow: 0 4px 15px rgba(255, 0, 127, 0.4);
}
