:root {
  --bg: #ffffff;
  --bg-soft: #C9DBF0;
  --card: #ffffff;
  --card-2: #fafafa;
  --line: #d9d9d9;
  --text: #111111;
  --muted: #666666;
  --accent-soft: #f1f1f1;
  --button: #111111;
  --button-text: #ffffff;
  --shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* BODY */
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  opacity: 1;
  transition: opacity 0.18s ease;
}

body.page-leaving {
  opacity: 0;
}

/* CONTAINER */
.container {
  width: min(100% - 16px, 480px);
  margin: 4px auto 0;
}

/* HEADER */
.site-header {
  padding: 4px 0 6px;
}

/* HERO */
.hero {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  line-height: 1.3; /* 🔥 BIAR TEXT RAPET */
}

/* BRAND */
.brand-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
}

.tagline {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--muted);
}

/* CONTACT */
.contact-info p {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: bold;
}

.contact-links {
  margin: 0;
  font-size: 11px;
}

.contact-links a {
  color: var(--text);
  text-decoration: underline;
}

/* CARD */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0;
  font-size: 13px;
}

.section-head p {
  margin: 4px 0 8px;
  font-size: 11px;
  color: var(--muted);
}

/* GAME GRID */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.game-card {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;

  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.game-card:hover {
  box-shadow: var(--shadow);
}

.game-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card h3 {
  margin: 0;
  font-size: 12px;
}

.game-card p {
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0;
}

.open-text {
  font-size: 11px;
  font-weight: bold;
}

/* PRICE CATEGORY */
.price-category {
  margin-bottom: 10px;
}

.price-category-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
}

.price-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* PRICE ITEM */
.price-item {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
}

.price-item.selected {
  border-color: #111;
  background: #eee;
}

.price-item h3 {
  margin: 0;
  font-size: 10px;
}

.price-item .price {
  font-size: 9px;
  color: var(--muted);
}

/* FORM */
.form-group {
  margin-bottom: 8px;
}

label {
  font-size: 10px;
  font-weight: bold;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font-size: 11px;
  background: #ffffff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

/* QUANTITY */
.qty-control {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 6px;
  align-items: center;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--button);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

#quantity {
  height: 36px;
  text-align: center;
}

/* BUTTON */
.button-row {
  margin: 10px 0;
}

.contact-btn {
  display: block;
  width: 100%;
  background: var(--button);
  color: var(--button-text);
  padding: 10px;
  border-radius: 12px;
  text-align: center;
  font-weight: bold;
  text-decoration: none;
  font-size: 12px;
}

/* BACK */
.back-link {
  font-size: 10px;
  text-decoration: none;
  color: var(--text);
}

/* EMPTY */
.empty-state {
  font-size: 11px;
  color: var(--muted);
}

/* RESPONSIVE */
@media (max-width: 360px) {
  .price-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* MODAL */
.order-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.order-modal.active {
  display: flex;
}

.order-modal-box {
  width: min(100% - 20px, 420px);
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 6px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

/* PREVIEW */
.preview-box {
  position: relative;
  margin-bottom: 8px;
}

.preview-box textarea {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  font-size: 11px;
}

.copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: var(--button);
  color: white;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 8px;
}

/* NOTE */
.order-note {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

/* ACTION BUTTON */
.order-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.order-action-row .contact-btn {
  font-size: 11px;
  padding: 10px 6px;
  text-align: center;
}

.order-action-row span {
  font-size: 10px;
  font-weight: normal;
  display: block;
  margin-top: 2px;
}

/* TELEGRAM STYLE */
.telegram-btn {
  background: #229ED9;
}

/* FIX HERO DETAIL PAGE */
.hero {
  position: relative;
  text-align: center;
  padding: 18px 14px;
}

/* BACK TOP BUTTON */
.back-top {
  position: absolute;
  top: 10px;
  left: 10px;

  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 50%;

  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: bold;

  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* BIAR BADGE GA KETABRAK TOMBOL */
.hero .badge {
  display: block;
  margin-bottom: 10px;
  padding-left: 34px;
  padding-right: 34px;
}

/* RAPihin TITLE */
.hero h1 {
  margin: 6px 0 10px;
  font-size: 24px;
  line-height: 1.2;
}

/* RAPihin SUBTITLE */
.hero-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

/* MODAL BIAR LEBIH RAPI */
.order-modal-box h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.preview-box textarea {
  min-height: 150px;
  padding-top: 12px;
  padding-right: 64px;
}

.order-note {
  font-size: 10px;
  line-height: 1.5;
}

.order-action-row .contact-btn {
  border: none;
  cursor: pointer;
}

.order-action-row .contact-btn span {
  opacity: 0.9;
}

.field-error {
  border-color: #e53935 !important;
  background: #fff5f5 !important;
}

.field-error-text {
  display: none;
  margin-top: 4px;
  font-size: 10px;
  color: #e53935;
}

.form-group.show-error .field-error-text {
  display: block;
}
