/* Global */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #059669;
  color: #0f172a;
}

/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #059669;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
}

.brand-text {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

/* Desktop nav */

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.desktop-nav > a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  position: relative;
  padding-bottom: 2px;
}

.desktop-nav > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #22c55e;
  transition: width 0.2s ease;
}

.desktop-nav > a:hover::after {
  width: 100%;
}

/* More dropdown */

.more-dropdown {
  position: relative;
}

.more-toggle {
  border: none;
  background: none;
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.98rem;
}

.more-menu {
  position: absolute;
  right: 0;
  top: 130%;
  min-width: 200px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  display: none;
  z-index: 1100;
}

.more-dropdown.open .more-menu {
  display: block;
}

.more-menu a {
  display: block;
  padding: 10px 18px;
  font-size: 0.93rem;
  color: #0f172a;
  text-decoration: none;
}

.more-menu a:hover {
  background: #ecfdf5;
  color: #059669;
}

/* Mobile nav */

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
}

.mobile-menu-icon,
.mobile-menu-icon::before,
.mobile-menu-icon::after {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  content: "";
  transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-icon {
  top: 50%;
  transform: translateY(-50%);
}

.mobile-menu-icon::before {
  top: -7px;
}

.mobile-menu-icon::after {
  top: 7px;
}

.mobile-menu-btn.open .mobile-menu-icon {
  background: transparent;
}

.mobile-menu-btn.open .mobile-menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.mobile-menu-btn.open .mobile-menu-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Slide-down menu */

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  background: #16a34a;
  z-index: 900;
  transition: transform 0.25s ease;
  padding-top: 64px;
}

.mobile-nav.open {
  transform: translateY(0);
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 16px 24px 32px;
}

.mobile-nav li + li {
  margin-top: 20px;
}

.mobile-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
}

/* HERO */

.page-header {
  text-align: center;
  padding: 72px 16px 60px;
  background: linear-gradient(135deg, #059669 0%, #22c55e 100%);
  color: #ffffff;
}

.hero-icon {
  font-size: 64px;
  margin-bottom: 12px;
}

.page-header h1 {
  margin: 0 0 16px;
  font-size: 2.4rem;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.page-header p {
  margin: 0;
  font-size: 1.05rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* CALCULATOR LAYOUT */

.calculator-container {
  max-width: 1200px;
  margin: -40px auto 40px;
  padding: 0 16px;
}

.calculator-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 32px 24px 34px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  margin-bottom: 24px;
}

.card-title {
  margin: 0 0 24px;
  font-size: 1.6rem;
  font-weight: 800;
  color: #059669;
}

/* Tabs */

.dice-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.dice-tab {
  border-radius: 999px;
  border: 2px solid #bbf7d0;
  background: #ecfdf5;
  color: #065f46;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.dice-tab:hover {
  border-color: #22c55e;
  transform: translateY(-1px);
}

.dice-tab.active {
  background: linear-gradient(135deg, #22c55e 0%, #0d9488 100%);
  color: #ffffff;
  border-color: transparent;
}

/* Inputs */

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.input-group {
  margin-bottom: 18px;
}

.input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #047857;
  margin-bottom: 6px;
}

.input-field {
  width: 100%;
  padding: 12px 13px;
  border-radius: 10px;
  border: 2px solid #22c55e;
  font-size: 0.98rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.input-field:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  transform: translateY(-1px);
}

/* Dice display */

.dice-display {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 30px 0 10px;
}

.dice {
  width: 90px;
  height: 90px;
  border-radius: 16px;
  background: linear-gradient(135deg, #22c55e 0%, #0d9488 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 2.1rem;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  position: relative;
}

.dice::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.dice-value {
  position: relative;
  z-index: 1;
}

/* Dice animations */

@keyframes rollDice {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.15); }
  50% { transform: rotate(180deg) scale(1); }
  75% { transform: rotate(270deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes bounceDice {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.dice-rolling {
  animation: rollDice 0.6s ease-in-out;
}

.bounce-animation {
  animation: bounceDice 0.4s ease-in-out;
}

/* Buttons */

.roll-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e 0%, #0d9488 100%);
  color: #ffffff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  margin-top: 8px;
}

.roll-btn:hover {
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

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

.add-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  margin-top: 6px;
}

.add-btn:hover {
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.4);
  transform: translateY(-1px);
}

/* Info box */

.info-box {
  margin-top: 18px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-left: 4px solid #22c55e;
}

.info-title {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #047857;
}

.info-text {
  margin: 0;
  font-size: 0.9rem;
  color: #065f46;
}

.info-text a {
  color: #0d9488;
  text-decoration: underline;
}

/* Adsense */

.adsense-container {
  margin: 24px 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #ecfdf5 0%, #bbf7d0 100%);
  border: 2px dashed #22c55e;
  padding: 22px 16px;
  text-align: center;
}

.adsense-placeholder {
  max-width: 520px;
  margin: 0 auto;
}

.adsense-icon {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.adsense-title {
  font-weight: 700;
  margin-bottom: 4px;
}

/* Results */

.result-display {
  border-radius: 20px;
  background: linear-gradient(135deg, #22c55e 0%, #0d9488 100%);
  padding: 26px 20px;
  color: #ffffff;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.result-card {
  background: rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 16px 14px 14px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.result-title {
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0.95;
  margin-bottom: 6px;
}

.result-value {
  font-size: 1.9rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.result-value-small {
  font-size: 1.2rem;
}

.result-subtitle {
  font-size: 0.82rem;
  opacity: 0.9;
}

/* Multiplayer list */

.player-list {
  margin-top: 18px;
  padding: 18px 16px;
  border-radius: 16px;
  border: 2px solid #22c55e;
  background: linear-gradient(135deg, #ecfdf5 0%, #bbf7d0 100%);
}

.player-list-title {
  margin: 0 0 10px;
  font-size: 1.02rem;
  color: #065f46;
  font-weight: 700;
}

.player-item {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 12px;
  border: 1px solid #bbf7d0;
  margin-bottom: 10px;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.player-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: #047857;
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.stat-item {
  padding: 7px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  text-align: center;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: #047857;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #059669;
}

.remove-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.remove-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.4);
}

.roll-history {
  margin-top: 8px;
  max-height: 80px;
  overflow-y: auto;
  background: #ecfdf5;
  border-radius: 8px;
  padding: 6px;
}

.history-item {
  display: inline-block;
  margin: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #047857;
  background: #ffffff;
  border: 1px solid #bbf7d0;
}

/* Download buttons */

.download-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.download-btn {
  flex: 1;
  min-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: none;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e 0%, #0d9488 100%);
  color: #ffffff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.download-btn:hover {
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

/* Toast message */

.toast-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

/* Blog */

.blog-section {
  max-width: 1000px;
  margin: 60px auto 40px;
  padding: 0 16px;
}

.blog-content {
  background: #ffffff;
  border-radius: 24px;
  padding: 32px 24px 34px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  line-height: 1.8;
}

.blog-content h2 {
  margin-top: 0;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #22c55e 0%, #0d9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-content h3 {
  margin-top: 26px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.blog-content p {
  font-size: 0.98rem;
  color: #111827;
}

.blog-content ul {
  padding-left: 20px;
  margin-top: 8px;
}

.blog-content li {
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.blog-content a {
  color: #0d9488;
  text-decoration: underline;
}

/* FAQ */

.faq-section {
  background: #ecfdf5;
  padding: 40px 0 50px;
}

.faq-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
}

.faq-inner h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
}

.faq-item + .faq-item {
  margin-top: 16px;
}

.faq-item h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #047857;
}

.faq-item p {
  margin: 0;
  font-size: 0.96rem;
  color: #111827;
}

/* Results table */

.table-wrapper {
  margin-top: 18px;
  background: #ffffff;
  border-radius: 14px;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.results-table th,
.results-table td {
  padding: 10px 12px;
  text-align: center;
}

.results-table th {
  background: linear-gradient(135deg, #22c55e 0%, #0d9488 100%);
  color: #ffffff;
  font-weight: 700;
}

.results-table tr:nth-child(even) td {
  background: #f9fafb;
}

/* Footer */

.footer {
  background: linear-gradient(135deg, #111827 0%, #020617 100%);
  color: #e5e7eb;
  padding: 40px 0 18px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.footer-column h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-top: 0;
  margin-bottom: 12px;
}

.footer-column p {
  font-size: 0.9rem;
  color: #d1d5db;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li + li {
  margin-top: 7px;
}

.footer-column a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-column a:hover {
  color: #22c55e;
}

.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  margin-top: 22px;
  padding-top: 14px;
  text-align: center;
  font-size: 0.86rem;
  color: #9ca3af;
}

/* Responsive */

@media (max-width: 900px) {
  .footer-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .page-header {
    padding: 60px 16px 50px;
  }

  .page-header h1 {
    font-size: 1.9rem;
  }

  .input-grid {
    grid-template-columns: 1fr;
  }

  .player-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-buttons {
    flex-direction: column;
  }

  .footer-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .brand-text {
    font-size: 0.96rem;
  }

  .dice {
    width: 80px;
    height: 80px;
    font-size: 1.7rem;
  }
}
