/* ---------- Base / Theme ---------- */
:root{
  --bg:#121213;
  --fg:#d7dadc;
  --tile-edge:#3a3a3c;
  --tile-good:#6aaa64;   
  --key:#818384;
  --key-bad:#3a3a3c;

  /* Responsive sizes */
  --tile: clamp(40px, 9vw, 76px);
  --tile-font: clamp(28px, 5vw, 38px);
  --gap: clamp(6px, 1vw, 10px);
  --kb-h: clamp(36px, 6vw, 52px);
  --kb-w: clamp(28px, 6vw, 56px);
  --title: clamp(22px, 3.2vw, 32px);
  --def: clamp(16px, 2.2vw, 20px);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Clear Sans","Helvetica Neue",Arial,sans-serif;
  background:var(--bg);
  color:var(--fg);
  display:flex;
  flex-direction:column;
  align-items:center;
}

/* ---------- Top bar ---------- */
.topbar{
  width:100%;
  max-width:720px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:10px 16px;
  border-bottom:1px solid #2a2a2a;
}
.logo{height:60px; width:auto; object-fit:contain}
.title{font-size:var(--title); font-weight:700; letter-spacing:.04em;}

/* ---------- Containers ---------- */
.game-container, .intro-container{
  width:100%;
  max-width:720px;
  padding:18px 16px 28px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:16px;
  text-align:center;
}

/* ---------- Intro button ---------- */
.primary-btn{
  display:inline-block;
  padding:12px 20px;
  border-radius:10px;
  background:var(--tile-good);
  color:white;
  text-decoration:none;
  font-weight:800;
  box-shadow:0 3px 0 #325c30;
}
.primary-btn:hover{transform:translateY(-1px)}

/* ---------- Heading ---------- */
.introheading{
  max-width:620px;
  font-size:30px;
  color:#ffffff;
  opacity:1.0;
}

/* ---------- Definition ---------- */
.definition{
  max-width:620px;
  font-size:25px;
  font-style:italic;
  color:#ffffff;
  opacity:1.0;
}

/* ---------- Intro Rules ---------- */
.introrules{
  max-width:620px;
  font-size:20px;
  color:#ffffff;
  opacity:1.0;
  text-align:left;
}

/* ---------- Target badge ---------- */
.target-wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}
.target-label{
  font-size:clamp(14px,2vw,16px);
  letter-spacing:.08em;
  opacity:.85;
}
.target-chip{
  display:flex;
  align-items:center;
  justify-content:center;
  width:clamp(120px,14vw,160px);
  height:clamp(120px,14vw,160px);
  border-radius:999px;
  font-size:clamp(40px,6vw,56px);
  font-weight:900;
  color:#fff;
  background: radial-gradient(80% 80% at 50% 20%, #2c2c2c, #1a1a1a);
  border:3px solid var(--tile-good);
  box-shadow:0 0 24px rgba(106,170,100,.35), inset 0 0 18px rgba(106,170,100,.25);
}

/* ---------- Tiles ---------- */
.letter-row{
  display:flex;
  gap:var(--gap);
  justify-content:center;
  flex-wrap:wrap;
}
.tile{
  width:var(--tile);
  height:var(--tile);
  border:2px solid var(--tile-edge);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:var(--tile-font);
  background:transparent;
  color:#fff;
  border-radius:6px;
  transition:transform .2s ease, background .2s ease, color .2s ease;
  cursor:pointer;
}

/* Four-digit tiles - wider but same height */
.tile.four-digit{
  width:calc(var(--tile) * 1.4);
  min-width:calc(var(--tile) * 1.4);
}

/* Mobile: Make 4-digit tiles even larger for better readability */
@media (max-width: 768px) {
  .tile.four-digit{
    width:calc(var(--tile) * 1.6);
    min-width:calc(var(--tile) * 1.6);
  }
  
  /* Make 3-digit tiles slightly wider on mobile for better readability */
  .tile:not(.four-digit) {
    width: calc(var(--tile) * 1.1);
    min-width: calc(var(--tile) * 1.1);
  }
  
  /* Make selection indicator smaller on mobile */
  .tile.created.selected::after{
    width: 6px !important;
    height: 6px !important;
  }
  
}

/* Selected tile → green for uncreated tiles */
.tile.selected{
  background: var(--tile-good);
  border-color: var(--tile-good);
  color: white;
  animation: tileSelection 0.3s ease-out;
}

/* Tile selection animation */
@keyframes tileSelection {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Selected created tiles → keep yellow background with selection indicator */
.tile.created.selected{
  background: #eab308;    /* Keep yellow background */
  border-color: #eab308;
  color: #111;
  position: relative;
}

/* Selection indicator for created tiles */
.tile.created.selected::after{
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #22c55e;    /* Green dot indicator */
  border-radius: 50%;
  border: 1px solid #111;
}

/* Newly created numbers → yellow (until used) */
.tile.created{
  background: #eab308;    /* amber-500 */
  border-color: #eab308;
  color: #111;
}

/* Animation only for newly created tiles */
.tile.newly-created{
  animation: tileCreation 0.6s ease-out;
}

/* Tile creation animation */
@keyframes tileCreation {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(180deg);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Used tile → greyed out */
.tile.used{
  opacity:.35;
  pointer-events:none;
}

/* ---------- Status & banner ---------- */
.status{display:flex; flex-direction:column; gap:6px; align-items:center}
.lives{font-size:clamp(16px, 2vw, 20px)}
.banner{margin-top:4px; font-weight:800}
.banner.win{color:var(--tile-good)}
.banner.lose{color:#ff6b6b}

/* ---------- Keyboard ---------- */
.keyboard{display:flex; flex-direction:column; gap:8px; width:100%; max-width:720px}
.kb-row{display:flex; justify-content:center; gap:8px; flex-wrap:wrap}
.key{
  min-width:var(--kb-w);
  height:var(--kb-h);
  padding:0 10px;
  border-radius:8px;
  border:none;
  font-weight:800;
  font-size:clamp(14px,2vw,18px);
  color:white;
  background:var(--key);
  cursor:pointer;
  transition:all .2s ease;
  position: relative;
  overflow: hidden;
}

/* Button press animation */
.key:active {
  animation: buttonPress 0.15s ease-out;
}

@keyframes buttonPress {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}
.key:disabled{opacity:.5; cursor:not-allowed}

/* Operator selected → green */
.key.selected{
  background: var(--tile-good);
  box-shadow:0 3px 0 #325c30;
  color:white;
}


/* ---------- Victory Modal ---------- */
.modal{
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  background:rgba(0,0,0,0.75);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1000;
}
.modal.hidden{display:none;}
.modal-content{
  background:#1a1a1a;
  color:white;
  padding:20px;
  border-radius:12px;
  max-width:400px;
  width:90%;
  text-align:center;
  box-shadow:0 0 20px rgba(0,0,0,0.6);
}
.modal-content h2{margin-top:0;}
.modal-content input{margin:10px 0; padding:6px; border-radius:6px; border:none;}

/* ---------- Mobile adjustments ---------- */
@media (max-width: 480px) {
  :root {
    --tile: clamp(50px, 12vw, 90px);       /* slightly wider tiles */
    --tile-font: clamp(32px, 6vw, 42px);   /* larger tile numbers */
    --kb-w: clamp(40px, 12vw, 70px);       /* wider keyboard buttons */
    --kb-h: clamp(40px, 12vw, 70px);       /* taller keyboard buttons */
  }

  .primary-btn {
    padding: 14px 24px;  /* larger buttons for mobile */
    font-size: clamp(18px, 4vw, 22px);
  }
}

/* Nav bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
  padding: 10px 16px;
  border-bottom: 1px solid #333;
}

.navbar .logo {
  color: white;
  font-weight: bold;
  font-size: 20px;
}

.navbar .menu-toggle {
  display: none;
  font-size: 26px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

.navbar .nav-links {
  list-style: none;
  display: flex;
  gap: 16px;
}

.navbar .nav-links li a {
  text-decoration: none;
  color: white;
  font-weight: 600;
}

/* Mobile view */
@media (max-width: 720px) {
  .navbar .menu-toggle {
    display: block;
  }
  .navbar .nav-links {
    display: none;
    flex-direction: column;
    background: #1a1a1a;
    position: absolute;
    top: 60px;
    right: 10px;
    border: 1px solid #333;
    padding: 10px;
  }
  .navbar .nav-links.show {
    display: flex;
  }
}

/* ---------- Submit button states ---------- */
.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #333;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: inline-block;
  margin-right: 6px;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#submit-score-btn.submitted {
  background-color: #4caf50; /* green */
  color: white;
  cursor: default;
  box-shadow: none;
}

/* ---------- Cookie Consent Banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  border-top: 2px solid #333;
  padding: 16px;
  z-index: 1001;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
}

.cookie-content {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.cookie-content p {
  color: #d7dadc;
  font-size: 14px;
  margin: 0;
  line-height: 1.4;
}

.cookie-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.cookie-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cookie-btn.accept {
  background: var(--tile-good);
  color: white;
}

.cookie-btn.accept:hover {
  background: #5a9a54;
}

.cookie-btn.reject {
  background: #666;
  color: white;
}

.cookie-btn.reject:hover {
  background: #555;
}

.cookie-link {
  color: #d7dadc;
  text-decoration: underline;
  font-size: 14px;
}

.cookie-link:hover {
  color: white;
}

/* Mobile adjustments for cookie banner */
@media (max-width: 480px) {
  .cookie-content {
    padding: 0 8px;
  }
  
  .cookie-content p {
    font-size: 13px;
  }
  
  .cookie-buttons {
    gap: 8px;
  }
  
  .cookie-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* ---------- Performance Optimizations ---------- */
.tile, .key {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Improved touch targets for mobile */
@media (max-width: 768px) {
  .tile {
    min-width: 48px;
    min-height: 48px;
  }
  
  .key {
    min-width: 48px;
    min-height: 48px;
  }
  
  .cookie-btn {
    min-width: 48px;
    min-height: 48px;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Legal Content Styling ---------- */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  text-align: left;
  line-height: 1.6;
}

.legal-content h1 {
  text-align: center;
  color: #ffffff;
  margin-bottom: 20px;
  font-size: 2.5em;
}

.legal-content h2 {
  color: #d7dadc;
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 1.5em;
  border-bottom: 2px solid var(--tile-good);
  padding-bottom: 5px;
}

.legal-content h3 {
  color: #d7dadc;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 1.2em;
}

.legal-content p {
  color: #d7dadc;
  margin-bottom: 15px;
  text-align: left;
}

.legal-content ul {
  margin: 15px 0;
  padding-left: 30px;
}

.legal-content li {
  color: #d7dadc;
  margin-bottom: 8px;
  text-align: left;
}

.legal-content strong {
  color: #ffffff;
}

.legal-content a {
  color: var(--tile-good);
  text-decoration: none;
}

.legal-content a:hover {
  text-decoration: underline;
}

.legal-content em {
  color: #a0a0a0;
  font-style: italic;
}

/* Mobile adjustments for legal content */
@media (max-width: 768px) {
  .legal-content {
    padding: 15px;
  }
  
  .legal-content h1 {
    font-size: 2em;
  }
  
  .legal-content h2 {
    font-size: 1.3em;
  }
  
  .legal-content ul {
    padding-left: 20px;
  }
}

/* ---------- Intro Page Styling ---------- */
.intro-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

.intro-content h1 {
  color: #ffffff;
  font-size: 3em;
  margin-bottom: 20px;
  font-weight: 900;
}

/* Hide line break by default (desktop) */
.mobile-break{
  display: none;
}

/* Simple highlight for user's name on leaderboards */
li.user-name {
  background-color: rgba(34, 197, 94, 0.2);
}

/* Celebration animation */
body.celebration {
  animation: celebrationPulse 2s ease-in-out;
}

@keyframes celebrationPulse {
  0%, 100% {
    filter: brightness(1);
  }
  25% {
    filter: brightness(1.2) saturate(1.3);
  }
  50% {
    filter: brightness(1.1) saturate(1.2);
  }
  75% {
    filter: brightness(1.15) saturate(1.25);
  }
}

/* Seasonal greeting styling */
.seasonal-greeting {
  margin: 20px 0;
  text-align: center;
}

.seasonal-greeting p {
  font-size: 1.5em;
  font-weight: bold;
  color: #fbbf24;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  margin: 0;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(255, 187, 36, 0.1), rgba(251, 191, 36, 0.2));
  border-radius: 10px;
  border: 2px solid rgba(251, 191, 36, 0.3);
}

.intro-description {
  margin-bottom: 40px;
}

.intro-description p {
  color: #d7dadc;
  font-size: 1.4em;
  font-style: italic;
  margin-bottom: 0;
}

.rules-section {
  margin-bottom: 40px;
}

.rules-section h2 {
  color: #ffffff;
  font-size: 2em;
  margin-bottom: 30px;
  border-bottom: 3px solid var(--tile-good);
  padding-bottom: 10px;
  display: inline-block;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.rule-item {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
}

.rule-item:hover {
  border-color: var(--tile-good);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(106, 170, 100, 0.2);
}

.rule-icon {
  font-size: 2em;
  flex-shrink: 0;
}

.rule-text {
  color: #d7dadc;
  text-align: left;
  line-height: 1.4;
}

.features-section {
  margin-bottom: 40px;
}

.features-section h2 {
  color: #ffffff;
  font-size: 2em;
  margin-bottom: 20px;
}

.features-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.feature-item {
  background: var(--tile-good);
  color: #111;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1.1em;
}

.start-section {
  margin-top: 40px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 35px;
  border-radius: 15px;
  background: var(--tile-good);
  color: white;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.3em;
  box-shadow: 0 6px 0 #325c30;
  transition: all 0.2s ease;
  margin-bottom: 15px;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #325c30;
}

.btn-icon {
  font-size: 1.2em;
}

.start-note {
  color: #a0a0a0;
  font-style: italic;
  margin: 0;
}

/* ---------- About Page Styling ---------- */
.about-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  text-align: left;
  line-height: 1.6;
}

.about-content h1 {
  color: #ffffff;
  font-size: 3em;
  text-align: center;
  margin-bottom: 30px;
  font-weight: 900;
}

.about-content h2 {
  color: #ffffff;
  font-size: 2em;
  margin-top: 40px;
  margin-bottom: 20px;
  border-bottom: 3px solid var(--tile-good);
  padding-bottom: 10px;
}

.about-content p {
  color: #d7dadc;
  margin-bottom: 20px;
  font-size: 1.1em;
}

.about-intro {
  text-align: center;
  margin-bottom: 40px;
}

.about-intro p {
  font-size: 1.3em;
  font-style: italic;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.feature-card {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  border-color: var(--tile-good);
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(106, 170, 100, 0.2);
}

.feature-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.feature-card h3 {
  color: #ffffff;
  font-size: 1.3em;
  margin-bottom: 10px;
  font-weight: 600;
}

.feature-card p {
  color: #d7dadc;
  font-size: 1em;
  margin: 0;
  line-height: 1.4;
}

.about-community, .about-thanks {
  text-align: center;
}

.about-community a {
  color: var(--tile-good);
  text-decoration: none;
  font-weight: 600;
}

.about-community a:hover {
  text-decoration: underline;
}

/* Mobile adjustments for intro and about pages */
@media (max-width: 768px) {
  .intro-content, .about-content {
    padding: 15px;
  }
  
  .intro-content h1, .about-content h1 {
    font-size: 2.5em;
  }
  
  /* Show line break for intro title on mobile */
  .mobile-break{
    display: block;
  }
  
  .rules-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .rule-item {
    padding: 15px;
    flex-direction: column;
    text-align: center;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .feature-card {
    padding: 20px;
  }
  
  .features-list {
    flex-direction: column;
    align-items: center;
  }
}

/* ---------- Contact Page Styling ---------- */
.contact-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  text-align: left;
  line-height: 1.6;
}

.contact-content h1 {
  color: #ffffff;
  font-size: 3em;
  text-align: center;
  margin-bottom: 30px;
  font-weight: 900;
}

.contact-content h2 {
  color: #ffffff;
  font-size: 2em;
  margin-top: 40px;
  margin-bottom: 20px;
  border-bottom: 3px solid var(--tile-good);
  padding-bottom: 10px;
}

.contact-content p {
  color: #d7dadc;
  margin-bottom: 20px;
  font-size: 1.1em;
}

.contact-intro {
  text-align: center;
  margin-bottom: 40px;
}

.contact-intro p {
  font-size: 1.3em;
  font-style: italic;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin: 30px 0;
}

.contact-card {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
}

.contact-card:hover {
  border-color: var(--tile-good);
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(106, 170, 100, 0.2);
}

.contact-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.contact-card h3 {
  color: #ffffff;
  font-size: 1.4em;
  margin-bottom: 15px;
  font-weight: 600;
}

.contact-card p {
  color: #d7dadc;
  font-size: 1em;
  margin-bottom: 20px;
  line-height: 1.5;
}

.contact-link {
  display: inline-block;
  background: var(--tile-good);
  color: #111;
  padding: 12px 25px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1em;
  transition: all 0.3s ease;
}

.contact-link:hover {
  background: #5a9a54;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(106, 170, 100, 0.3);
}

.info-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.info-item {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s ease;
}

.info-item:hover {
  border-color: var(--tile-good);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(106, 170, 100, 0.2);
}

.info-icon {
  font-size: 2em;
  flex-shrink: 0;
}

.info-text {
  color: #d7dadc;
  text-align: left;
  line-height: 1.4;
}

.info-text strong {
  color: #ffffff;
}

.contact-thanks {
  text-align: center;
  margin-top: 40px;
}

/* Mobile adjustments for contact page */
@media (max-width: 768px) {
  .contact-content {
    padding: 15px;
  }
  
  .contact-content h1 {
    font-size: 2.5em;
  }
  
  .contact-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .contact-card {
    padding: 25px;
  }
  
  .info-list {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .info-item {
    padding: 15px;
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- Play Page Improvements ---------- */
.game-instructions {
  text-align: center;
  margin: 15px 0;
  padding: 10px 20px;
  background: rgba(106, 170, 100, 0.1);
  border: 1px solid rgba(106, 170, 100, 0.3);
  border-radius: 8px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Reduce spacing for expression and history areas */
#expr {
  margin: 5px 0 !important;
  min-height: 20px !important;
}

#history {
  margin: 5px 0 !important;
  min-height: 0 !important;
}

.game-instructions p {
  color: #d7dadc;
  font-size: 14px;
  margin: 0;
  font-style: italic;
}

.leaderboard-section {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  flex-wrap: wrap;
}

/* Enhanced Modal Styling */
.modal-content {
  background: #1a1a1a;
  color: white;
  padding: 30px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
  border: 2px solid #333;
  animation: victoryModal 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Victory modal animation */
@keyframes victoryModal {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(-50px);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.05) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.8em;
}

.score-instructions {
  color: #d7dadc;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.name-input {
  width: 100%;
  max-width: 200px;
  padding: 12px;
  border: 2px solid #333;
  border-radius: 8px;
  background: #2a2a2a;
  color: white;
  font-size: 18px;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 20px;
  transition: border-color 0.3s ease;
}

.name-input:focus {
  outline: none;
  border-color: var(--tile-good);
  box-shadow: 0 0 10px rgba(106, 170, 100, 0.3);
}

.submit-btn {
  background: var(--tile-good);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.submit-btn:hover {
  background: #5a9a54;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(106, 170, 100, 0.3);
}

.submit-btn:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.score-content {
  margin: 20px 0;
  padding: 15px;
  background: rgba(106, 170, 100, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(106, 170, 100, 0.2);
}

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

.close-btn {
  background: #666;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: #777;
  transform: translateY(-1px);
}

/* Enhanced Banner Styling */
.banner {
  margin: 0;
  padding: 0;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner:not(:empty) {
  margin: 15px 0;
  padding: 12px 20px;
  background: rgba(106, 170, 100, 0.1);
  border: 1px solid rgba(106, 170, 100, 0.3);
  color: var(--tile-good);
  min-height: 20px;
}

/* Mobile improvements for play page */
@media (max-width: 768px) {
  .game-instructions {
    margin: 10px 15px;
    padding: 8px 15px;
  }
  
  .game-instructions p {
    font-size: 13px;
  }
  
  .modal-content {
    padding: 20px;
    margin: 20px;
  }
  
  .name-input {
    font-size: 16px;
    padding: 10px;
  }
  
  .leaderboard-section {
    margin-top: 2px;
  }
}