/* =========================
   VARIABLES & RESET
========================= */
:root {
  --primary: #1976d2;
  --primary-dark: #1565c0;
  --primary-light: #42a5f5;
  --text: #222;
  --text-muted: #666;
  --bg: #f5f5f5;
  --bg-light: #e3f0ff;
  --white: #ffffff;
  --border: #ddd;
  --border-light: #bcd;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(25, 118, 210, 0.08);
  --shadow-md: 0 4px 16px rgba(25, 118, 210, 0.12);
  --shadow-lg: 0 8px 32px rgba(25, 118, 210, 0.2);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Yu Gothic UI', 'Arial', sans-serif;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg) 100%);
  background-size: 200% 200%;
  animation: backgroundMove 40s ease infinite;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* =========================
   HEADER
========================= */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  border-radius: 0 0 var(--radius) var(--radius);
}

.title-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: var(--transition);
}

.title-link:hover {
  transform: translateY(-1px);
}

.logo {
  height: 40px;
  width: 40px;
  margin-right: 10px;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: rotate(10deg) scale(1.05);
}

.header1 {
  font-size: 1.6em;
  font-weight: 800;
  background: linear-gradient(270deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientText 6s ease infinite;
}

/* =========================
   NAVIGATION
========================= */
nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.company-btn {
  padding: 12px 20px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9em;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.company-btn:hover,
.company-btn.active {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Header search input */
#header-search {
  font-size: 0.95em;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

#header-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

#header-search-results {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
}

/* =========================
   MAIN CONTENT
========================= */
main {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 16px;
}

h1 {
  text-align: center;
  font-size: 2.4em;
  margin-bottom: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

h3 {
  font-size: 1.4em;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

/* =========================
   HERO SECTION
========================= */
.hero {
  text-align: center;
  margin: 48px 0 56px;
  position: relative;
}

.hero-logo {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-bottom: 32px;
  transition: var(--transition);
  animation: pulse 3s ease-in-out infinite;
}

.hero-logo:hover {
  transform: scale(1.05);
}

.hero h1 {
  font-size: 3.2em;
  font-weight: 900;
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.hero p {
  font-size: 1.5em;
  color: var(--text);
  margin-bottom: 32px;
}

/* =========================
   SEARCH FORM
========================= */
#search-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto 24px auto;
}

#search-input {
  flex: 1;
  font-size: 1.2em;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

#search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

#search-form button {
  font-size: 1.2em;
  padding: 12px 24px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--white);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

#search-form button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* =========================
   SEARCH RESULTS
========================= */
#search-results {
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
}

#search-results .station {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 18px;
  transition: var(--transition);
}

#search-results .station:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

#search-results .station-text strong {
  font-size: 1.2em;
  color: var(--primary);
  display: block;
  margin-bottom: 6px;
}

#search-results .station-text strong a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

#search-results .station-text em {
  color: var(--text-muted);
  display: block;
  font-size: 1em;
  font-style: normal;
  margin-bottom: 8px;
}

/* =========================
   LINE GROUPS & BUTTONS
========================= */
.line-group {
  margin-bottom: 48px;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.line-group h3 {
  font-size: 1.6em;
  margin-bottom: 20px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.line-buttons-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.line-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--white);
  border: 2px solid var(--bg);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.line-button:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--bg-light);
}

.line-logo {
  width: 28px;
  height: auto;
  flex-shrink: 0;
}

.line-name {
  font-size: 1em;
}

/* =========================
   STATION CARDS
========================= */
.station-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.station-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.station-title {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.station-title a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.melody-item {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition);
}

.melody-item:hover {
  background: #d6eaff;
}

.melody-name {
  font-weight: 600;
  font-size: 1.1em;
  color: var(--text);
  margin-bottom: 6px;
}

.melody-line {
  font-size: 0.9em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* =========================
   AUDIO CONTROLS
========================= */
audio {
  width: 100%;
  height: 32px;
  border-radius: 6px;
  outline: none;
  transition: var(--transition);
}

audio:hover {
  transform: scale(1.02);
}

.header-station-audio {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
}

.melody-audio {
  margin-bottom: 6px;
}

/* Loop checkbox styling */
input[type="checkbox"] {
  margin-right: 6px;
  accent-color: var(--primary);
}

label {
  font-size: 0.85em;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

/* =========================
   PLAY STATS SECTION
========================= */
.play-stats-section {
  margin: 60px auto;
  max-width: 900px;
  text-align: center;
}

.stats-container {
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f0ff 100%);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.stats-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(25, 118, 210, 0.05) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

.stats-container h2 {
  font-size: 1.8em;
  color: #0d47a1;
  margin-bottom: 30px;
  font-weight: 700;
  position: relative;
  z-index: 2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
  position: relative;
  z-index: 2;
}

.stat-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-box:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-box div:first-child {
  font-size: 1em;
  color: #555;
  margin-bottom: 8px;
}

#playCountNumber, #stationCount, #melodyCount {
  font-size: 2.2em;
  font-weight: 800;
  color: var(--primary);
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================
   NEWS & HOWTO SECTIONS
========================= */
.news, .howto {
  margin-bottom: 56px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 32px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.news h2, .howto h2 {
  font-size: 1.5em;
  color: var(--primary);
  margin-bottom: 16px;
}

.news ul, .howto ol {
  font-size: 1.15em;
  color: #444;
  line-height: 2;
}

.news li, .howto li {
  margin-bottom: 8px;
}

/* =========================
   FILTERS
========================= */
#line-filter {
  width: 100%;
  max-width: 300px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--white);
  font-size: 1em;
  transition: var(--transition);
  outline: none;
}

#line-filter:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* =========================
   FOOTER
========================= */
footer {
  background: var(--bg-light);
  text-align: center;
  padding: 24px 16px;
  margin-top: 60px;
  border-top: 1px solid var(--border);
}

.footer-logo-link {
  display: inline-block;
  margin-bottom: 16px;
  transition: var(--transition);
}

.footer-logo-link:hover {
  transform: translateY(-2px);
}

.footer-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.footer-icon:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: var(--shadow-md);
}

.footer-links {
  margin: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.footer-links a:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

footer > div:last-child {
  color: #bbb;
  font-size: 0.95em;
  max-width: 800px;
  margin: 12px auto;
  line-height: 1.5;
}

footer a {
  color: var(--primary);
  transition: var(--transition);
}

footer a:hover {
  color: var(--primary-dark);
}

/* =========================
   ANIMATIONS
========================= */
@keyframes backgroundMove {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes gradientText {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 200% 50%; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* =========================
   UTILITY CLASSES
========================= */
.fadeInUp {
  animation: fadeInUp 0.6s ease forwards;
}

.text-center {
  text-align: center;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mb-32 {
  margin-bottom: 32px;
}

/* =========================
   RESPONSIVE DESIGN
========================= */
@media screen and (max-width: 992px) {
  main {
    max-width: 95%;
  }
  
  .line-buttons-container {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }
}

@media screen and (max-width: 768px) {
  html {
    font-size: 15px;
  }

  /* Header adjustments */
  header {
    height: auto;
    padding: 12px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .header1 {
    font-size: 1.4em;
  }

  nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .company-btn {
    padding: 8px 16px;
    font-size: 0.85em;
  }

  #header-search {
    width: 100%;
    max-width: 300px;
    margin: 8px auto;
  }

  /* Hero section */
  .hero {
    padding: 32px 16px 24px 16px;
    margin-bottom: 40px;
  }

  .hero-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
  }

  .hero h1 {
    font-size: 2.2em;
    margin-bottom: 16px;
    letter-spacing: 1px;
  }

  .hero p {
    font-size: 1.2em;
    margin-bottom: 24px;
  }

  /* Search form */
  #search-form {
    flex-direction: column;
    max-width: 100%;
    gap: 12px;
  }

  #search-form input,
  #search-form button {
    width: 100%;
    font-size: 1.1em;
    padding: 14px 16px;
  }

  /* Line groups */
  .line-group {
    padding: 20px;
    margin-bottom: 32px;
  }

  .line-buttons-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .line-button {
    padding: 12px 16px;
    justify-content: flex-start;
  }

  /* Stats section */
  .play-stats-section {
    margin: 40px 12px;
  }

  .stats-container {
    padding: 24px;
    border-radius: var(--radius-lg);
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-box {
    padding: 16px;
  }

  #playCountNumber,
  #stationCount,
  #melodyCount {
    font-size: 1.8em;
  }

  /* News and howto sections */
  .news, .howto {
    margin: 32px 12px;
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .news h2, .howto h2 {
    font-size: 1.3em;
  }

  .news ul, .howto ol {
    font-size: 1em;
    line-height: 1.6;
  }

  /* Station cards */
  .station-card {
    padding: 16px;
    margin-bottom: 16px;
  }

  .station-title {
    font-size: 1.2em;
  }

  .melody-item {
    padding: 12px;
  }

  /* Footer */
  footer {
    padding: 20px 12px;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }

  .footer-links a {
    display: block;
    text-align: center;
  }
}

@media screen and (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .hero h1 {
    font-size: 1.8em;
    letter-spacing: 0.5px;
  }

  .hero p {
    font-size: 1.1em;
  }

  .line-group {
    padding: 16px;
  }

  .stats-container {
    padding: 20px;
  }

  .news, .howto {
    padding: 16px;
  }
}

/* =========================
   PRINT STYLES
========================= */
@media print {
  header, footer, nav, .company-btn, audio, button, input {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .station-card, .melody-item {
    break-inside: avoid;
    border: 1px solid #ccc;
    margin-bottom: 10px;
  }
}

/* Simple mobile header fix - just add/update these mobile styles */

@media screen and (max-width: 768px) {
  /* Header adjustments - keep it simple and compact */
  header {
    height: 64px; /* Fixed height */
    padding: 0 16px;
    flex-wrap: nowrap; /* Prevent wrapping */
    gap: 0;
  }

  .header1 {
    font-size: 1.4em;
  }

  /* Hide the entire navigation on mobile */
  nav {
    display: none;
  }

  /* Hide header search input specifically on mobile */
  #header-search {
    display: none;
  }

  /* Rest of your existing mobile styles remain exactly the same... */
  .hero {
    padding: 32px 16px 24px 16px;
    margin-bottom: 40px;
  }

  .hero-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
  }

  .hero h1 {
    font-size: 2.2em;
    margin-bottom: 16px;
    letter-spacing: 1px;
  }

  .hero p {
    font-size: 1.2em;
    margin-bottom: 24px;
  }

  #search-form {
    flex-direction: column;
    max-width: 100%;
    gap: 12px;
  }

  #search-form input,
  #search-form button {
    width: 100%;
    font-size: 1.1em;
    padding: 14px 16px;
  }

  .line-group {
    padding: 20px;
    margin-bottom: 32px;
  }

  .line-buttons-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .line-button {
    padding: 12px 16px;
    justify-content: flex-start;
  }

  .play-stats-section {
    margin: 40px 12px;
  }

  .stats-container {
    padding: 24px;
    border-radius: var(--radius-lg);
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-box {
    padding: 16px;
  }

  #playCountNumber,
  #stationCount,
  #melodyCount {
    font-size: 1.8em;
  }

  .news, .howto {
    margin: 32px 12px;
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .news h2, .howto h2 {
    font-size: 1.3em;
  }

  .news ul, .howto ol {
    font-size: 1em;
    line-height: 1.6;
  }

  .station-card {
    padding: 16px;
    margin-bottom: 16px;
  }

  .station-title {
    font-size: 1.2em;
  }

  .melody-item {
    padding: 12px;
  }

  footer {
    padding: 20px 12px;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }

  .footer-links a {
    display: block;
    text-align: center;
  }
}

/* Simple mobile header fix - just add/update these mobile styles */

@media screen and (max-width: 768px) {
  /* Reduce base font size for mobile */
  html {
    font-size: 14px;
  }

  /* Header adjustments - keep it simple and compact */
  header {
    height: 56px; /* Smaller header */
    padding: 0 16px;
    flex-wrap: nowrap;
    gap: 0;
  }

  .header1 {
    font-size: 1.2em; /* Smaller header title */
  }

  /* Hide the entire navigation on mobile */
  nav {
    display: none;
  }

  /* Hide header search input specifically on mobile */
  #header-search {
    display: none;
  }

  /* Compact hero section */
  .hero {
    padding: 24px 16px 20px 16px;
    margin-bottom: 32px;
  }

  .hero-logo {
    width: 100px; /* Smaller logo */
    height: 100px;
    margin-bottom: 16px;
  }

  .hero h1 {
    font-size: 1.8em; /* Much smaller main title */
    margin-bottom: 12px;
    letter-spacing: 0.5px;
  }

  .hero p {
    font-size: 1.1em; /* Smaller subtitle */
    margin-bottom: 20px;
  }

  /* Make main page headings smaller */
  h1 {
    font-size: 1.8em;
    margin-bottom: 16px;
  }

  h2 {
    font-size: 1.4em;
    margin-bottom: 12px;
  }

  h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
  }

  /* Compact search form */
  #search-form {
    flex-direction: column;
    max-width: 100%;
    gap: 10px;
    margin-bottom: 20px;
  }

  #search-form input,
  #search-form button {
    width: 100%;
    font-size: 1em;
    padding: 12px 14px;
  }

  /* Compact line groups */
  .line-group {
    padding: 16px;
    margin-bottom: 24px;
  }

  .line-group h3 {
    font-size: 1.2em;
    margin-bottom: 12px;
  }

  .line-buttons-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .line-button {
    padding: 10px 14px;
    justify-content: flex-start;
    font-size: 0.9em;
  }

  .line-logo {
    width: 24px;
  }

  /* Compact stats section */
  .play-stats-section {
    margin: 32px 12px;
  }

  .stats-container {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .stats-container h2 {
    font-size: 1.4em;
    margin-bottom: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-box {
    padding: 12px;
  }

  .stat-box div:first-child {
    font-size: 0.9em;
    margin-bottom: 6px;
  }

  #playCountNumber,
  #stationCount,
  #melodyCount {
    font-size: 1.6em;
  }

  /* Compact news and howto sections */
  .news, .howto {
    margin: 24px 12px;
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .news h2, .howto h2 {
    font-size: 1.2em;
    margin-bottom: 12px;
  }

  .news ul, .howto ol {
    font-size: 0.9em;
    line-height: 1.5;
  }

  .news li, .howto li {
    margin-bottom: 6px;
  }

  /* Compact station cards */
  .station-card {
    padding: 14px;
    margin-bottom: 14px;
  }

  .station-title {
    font-size: 1.1em;
    margin-bottom: 12px;
  }

  .melody-item {
    padding: 10px;
    margin-bottom: 10px;
  }

  .melody-name {
    font-size: 1em;
    margin-bottom: 4px;
  }

  .melody-line {
    font-size: 0.85em;
    margin-bottom: 6px;
  }

  /* Compact footer */
  footer {
    padding: 16px 12px;
    margin-top: 40px;
  }

  .footer-links {
    flex-direction: column;
    gap: 6px;
    margin: 12px 0;
  }

  .footer-links a {
    display: block;
    text-align: center;
    padding: 6px 10px;
    font-size: 0.9em;
  }

  footer > div:last-child {
    font-size: 0.85em;
    margin: 10px auto;
  }
}
/* Simple mobile header fix - just add/update these mobile styles */

@media screen and (max-width: 768px) {
  /* Reduce base font size for mobile */
  html {
    font-size: 14px;
  }

  /* Header adjustments - keep it simple and compact */
  header {
    height: 56px; /* Smaller header */
    padding: 0 16px;
    flex-wrap: nowrap;
    gap: 0;
  }

  .header1 {
    font-size: 1.2em; /* Smaller header title */
  }

  /* Hide the entire navigation on mobile */
  nav {
    display: none;
  }

  /* Hide header search input specifically on mobile */
  #header-search {
    display: none;
  }

  /* Compact hero section */
  .hero {
    padding: 24px 16px 20px 16px;
    margin-bottom: 32px;
  }

  .hero-logo {
    width: 100px; /* Smaller logo */
    height: 100px;
    margin-bottom: 16px;
  }

  .hero h1 {
    font-size: 1.8em; /* Much smaller main title */
    margin-bottom: 12px;
    letter-spacing: 0.5px;
  }

  .hero p {
    font-size: 1.1em; /* Smaller subtitle */
    margin-bottom: 20px;
  }

  /* Make main page headings smaller */
  h1 {
    font-size: 1.8em;
    margin-bottom: 16px;
  }

  h2 {
    font-size: 1.4em;
    margin-bottom: 12px;
  }

  h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
  }

  /* Compact hero section specific styles */
  .hero h1 {
    font-size: 1.5em !important; /* Override inline styles */
    margin-bottom: 12px !important;
    letter-spacing: 0.5px !important;
    line-height: 1.2;
  }

  .hero p {
    font-size: 1em !important; /* Much smaller subtitle */
    margin-bottom: 16px !important;
    line-height: 1.4;
  }

  /* Compact the entire hero section */
  .hero {
    padding: 20px 16px 16px 16px !important;
    margin-bottom: 24px !important;
  }

  /* Compact quick links section */
  .quick-links {
    margin-bottom: 32px !important;
  }

  .quick-links h2 {
    font-size: 1.2em !important;
    margin-bottom: 12px !important;
  }

  .quick-btns {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center;
  }

  .quick-btns .company-btn {
    min-width: auto !important;
    width: 100% !important;
    max-width: 280px;
    font-size: 1em !important;
    padding: 12px 20px !important;
  }

  .quick-btns .company-btn img {
    height: 24px !important;
  }

  /* Compact main content */
  main {
    padding: 0 12px;
  }

  /* Compact search form */
  #search-form {
    flex-direction: column;
    max-width: 100%;
    gap: 10px;
    margin-bottom: 20px;
  }

  #search-form input,
  #search-form button {
    width: 100%;
    font-size: 1em;
    padding: 12px 14px;
  }

  /* Compact line groups */
  .line-group {
    padding: 16px;
    margin-bottom: 24px;
  }

  .line-group h3 {
    font-size: 1.2em;
    margin-bottom: 12px;
  }

  .line-buttons-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .line-button {
    padding: 10px 14px;
    justify-content: flex-start;
    font-size: 0.9em;
  }

  .line-logo {
    width: 24px;
  }

  /* Compact stats section */
  .play-stats-section {
    margin: 32px 12px;
  }

  .stats-container {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .stats-container h2 {
    font-size: 1.4em;
    margin-bottom: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-box {
    padding: 12px;
  }

  .stat-box div:first-child {
    font-size: 0.9em;
    margin-bottom: 6px;
  }

  #playCountNumber,
  #stationCount,
  #melodyCount {
    font-size: 1.6em;
  }

  /* Compact news and howto sections */
  .news, .howto {
    margin: 24px 12px;
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .news h2, .howto h2 {
    font-size: 1.2em;
    margin-bottom: 12px;
  }

  .news ul, .howto ol {
    font-size: 0.9em;
    line-height: 1.5;
  }

  .news li, .howto li {
    margin-bottom: 6px;
  }

  /* Compact station cards */
  .station-card {
    padding: 14px;
    margin-bottom: 14px;
  }

  .station-title {
    font-size: 1.1em;
    margin-bottom: 12px;
  }

  .melody-item {
    padding: 10px;
    margin-bottom: 10px;
  }

  .melody-name {
    font-size: 1em;
    margin-bottom: 4px;
  }

  .melody-line {
    font-size: 0.85em;
    margin-bottom: 6px;
  }

  /* Compact footer */
  footer {
    padding: 16px 12px;
    margin-top: 40px;
  }

  .footer-links {
    flex-direction: column;
    gap: 6px;
    margin: 12px 0;
  }

  .footer-links a {
    display: block;
    text-align: center;
    padding: 6px 10px;
    font-size: 0.9em;
  }

  footer > div:last-child {
    font-size: 0.85em;
    margin: 10px auto;
  }
}