/* ════════════════════════════════════
   RESPONSIVE — COMPREHENSIVE SYSTEM
   Covers: Desktop → Tablet → Mobile → Small Phone
   ════════════════════════════════════ */

/* ── Page Header (Tool pages) ── */
.page-header {
  padding-top: calc(var(--nav-h) + 32px);
  padding-bottom: 40px;
  padding-left: 20px;
  padding-right: 20px;
  text-align: center;
}
.page-header h1 {
  font-size: clamp(1.6rem, 5vw, 3rem);
  line-height: 1.15;
}
.page-header p {
  font-size: clamp(13px, 2vw, 16px);
  max-width: 560px;
  margin: 12px auto 0;
}

/* ── Large Desktop (≥1200px) ── */
@media (min-width: 1200px) {
  .container { padding: 0 32px; }
  .app-grid  { grid-template-columns: repeat(7, 1fr); }
}

/* ── Tablet landscape (≤1024px) ── */
@media (max-width: 1024px) {
  .hero-content { max-width: 680px; padding: 48px 28px; }
  .footer-grid  { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Tablet portrait (≤900px) ── */
@media (max-width: 900px) {
  .pillars-grid      { grid-template-columns: 1fr; }
  .tools-preview     { grid-template-columns: repeat(2, 1fr); }
  .crypto-mini-grid  { grid-template-columns: repeat(2, 1fr); }
  .tutorial-grid     { grid-template-columns: repeat(2, 1fr); }
  .footer-grid       { grid-template-columns: 1fr 1fr; }
  .stats-row         { grid-template-columns: repeat(2, 1fr); }
  .app-grid          { grid-template-columns: repeat(4, 1fr); }
  /* Tool pages */
  .beautifier-layout { grid-template-columns: 1fr !important; }
  .editor-split      { grid-template-columns: 1fr !important; }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
  :root {
    --nav-h:    56px;
    --bottom-h: 60px;
  }

  /* Layout */
  .container { padding: 0 16px; }
  .section   { padding: 48px 0; }

  /* Hero */
  .hero-content {
    padding: 32px 18px;
    border-radius: var(--r-lg);
    box-shadow: 8px 8px 0 #000;
    transform: rotate(0);
  }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn-primary, .btn-secondary {
    text-align: center;
    justify-content: center;
    padding: 13px 24px;
    font-size: 15px;
  }

  /* Grids */
  .tools-preview    { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .tutorial-grid    { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .app-grid         { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .stats-row        { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .footer-grid      { grid-template-columns: 1fr; }
  .footer-bottom    { flex-direction: column; gap: 10px; text-align: center; }

  /* Navbar */
  .logo-text  { font-size: 24px; }
  .logo-badge { width: 34px; height: 34px; font-size: 18px; }
  .nav-clock  { display: none; }

  /* Bottom nav */
  .bottom-nav-text { display: none; }
  .bottom-nav-icon { font-size: 24px; }

  /* Scroll top */
  #scrollTop { width: 44px; height: 44px; font-size: 22px; right: 14px; }

  /* Cards */
  .pillar-card  { padding: 24px 16px; }
  .tool-card    { padding: 18px 14px; }

  /* Tool pages inline */
  .drop-zone { padding: 44px 20px !important; }
  .drop-icon { font-size: 48px !important; }
  .drop-title { font-size: 18px !important; }
  .action-bar { flex-wrap: wrap !important; gap: 8px !important; }

  /* CTA */
  .cta-inner { padding: 36px 20px; transform: rotate(0); border-radius: var(--r-lg); }
  .cta-inner h2 { font-size: 2rem; }

  /* Section header */
  .section-badge { font-size: 13px; }
  .section-sub   { font-size: 14px; padding: 8px 14px; }
}

/* ── Small phone (≤480px) ── */
@media (max-width: 480px) {
  :root {
    --nav-h:    54px;
    --bottom-h: 58px;
  }

  .container { padding: 0 12px; }
  .section   { padding: 40px 0; }

  /* Hero */
  .hero-content { padding: 28px 14px; }
  .hero-badge   { font-size: 12px; padding: 4px 14px; }

  /* Grids */
  .tools-preview    { grid-template-columns: 1fr; }
  .tutorial-grid    { grid-template-columns: 1fr; }
  .crypto-mini-grid { grid-template-columns: 1fr 1fr; }
  .app-grid         { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .app-icon         { width: 64px; height: 64px; }
  .app-label        { font-size: 11px; max-width: 68px; }

  /* Navbar */
  .logo-text  { font-size: 22px; letter-spacing: 2px; }
  .logo-badge { width: 32px; height: 32px; font-size: 16px; }
  .nav-actions { gap: 6px; }

  /* Bottom nav */
  .bottom-nav-icon { font-size: 22px; }
  .bottom-nav-link { gap: 0; }

  /* Scroll top */
  #scrollTop { width: 40px; height: 40px; font-size: 20px; right: 10px; bottom: calc(var(--bottom-h) + 10px); }

  /* Typography */
  .stat-num     { font-size: 2.2rem; }
  .pillar-title { font-size: 22px; }
  .tool-name    { font-size: 18px; }
  .article-title { font-size: 15px; }

  /* CTA */
  .cta-inner { padding: 28px 14px; }
  .cta-inner h2 { font-size: 1.7rem; }
  .cta-inner p  { font-size: 14px; }

  /* Tool pages */
  .page-header { padding-top: calc(var(--nav-h) + 20px); padding-bottom: 28px; }
  .converter-wrap { padding: 0 4px; }
  .drop-zone  { padding: 36px 14px !important; border-radius: var(--r-lg) !important; }
  .drop-icon  { font-size: 40px !important; }
  .drop-title { font-size: 16px !important; }
  .drop-sub   { font-size: 12px !important; }
  .btn-file   { padding: 10px 22px !important; font-size: 13px !important; }

  /* Result grid in converter → stack */
  #singleResultContainer > div { grid-template-columns: 1fr !important; }

  /* Format select */
  select { font-size: 14px !important; padding: 10px 12px !important; }

  /* Pages grid (PDF) */
  .pages-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Footer */
  .footer { padding: 40px 0 20px; }
  .footer-grid { gap: 24px; }
  .footer-bottom { font-size: 12px; }

  /* PWA Banner */
  .pwa-banner-inner  { padding: 10px 12px; gap: 8px; }
  .pwa-banner-icon   { width: 44px; height: 44px; font-size: 22px; }
  .pwa-btn-install   { padding: 6px 14px; font-size: 13px; }
}

/* ── Extra small (≤360px) — covers small Android ── */
@media (max-width: 360px) {
  .container { padding: 0 10px; }

  .app-grid  { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .app-icon  { width: 56px; height: 56px; border-radius: 14px; }
  .app-label { font-size: 10px; max-width: 60px; }

  .logo-text  { font-size: 20px; }
  .logo-badge { width: 30px; height: 30px; font-size: 15px; }

  .bottom-nav-icon { font-size: 20px; }

  .hero-content { padding: 22px 12px; border-radius: var(--r-md); }
  .hero-badge   { font-size: 11px; }

  .drop-zone  { padding: 28px 10px !important; }
  .drop-icon  { font-size: 36px !important; }
  .drop-title { font-size: 14px !important; }
  .drop-sub   { font-size: 11px !important; }
}

/* ── Landscape phone — prevent content cut ── */
@media (max-width: 768px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: calc(var(--nav-h) + 16px); padding-bottom: 32px; }
  .hero-content { padding: 24px 20px; }
  .page-header { padding-top: calc(var(--nav-h) + 16px); padding-bottom: 20px; }
}

/* ── iOS Safe Area (notch/home indicator) ── */
@supports (padding: max(0px)) {
  .navbar {
    padding-left:  max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  .bottom-nav {
    padding-bottom: max(env(safe-area-inset-bottom), 4px);
    height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  }
  body { padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
}

/* ── Touch UX improvements (all mobile) ── */
@media (hover: none) {
  /* Disable hover transform effects on touch (no hover flicker) */
  .tool-card:hover,
  .pillar-card:hover,
  .article-card:hover,
  .crypto-mini-card:hover { transform: none; box-shadow: var(--shadow-md); }

  /* Bigger tap targets */
  .bottom-nav-link { min-height: 48px; }
  .btn-primary, .btn-secondary { min-height: 48px; }
  .btn-file { min-height: 48px !important; }
  .appsec-more { min-height: 44px; }
  a, button { -webkit-tap-highlight-color: transparent; }
}

/* ── Fluid font size utility ── */
h1 { font-size: clamp(1.8rem, 5vw, 4rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.6rem); }

/* ── Scrollbar (desktop only) ── */
@media (min-width: 769px) {
  ::-webkit-scrollbar { width: 8px; }
  ::-webkit-scrollbar-track { background: #f1f1f1; }
  ::-webkit-scrollbar-thumb { background: #000; border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--pink); }
}

/* ══════════════════════════════════════════
   PROFILE PAGE — Neo-Brutalist (matches index.html)
   ══════════════════════════════════════════ */

/* Wrap — centered column */
.prof-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: calc(var(--nav-h, 64px) + 32px) 20px calc(var(--bottom-h, 66px) + 32px);
}

/* ── Header Card: Avatar + Name ── */
.prof-header-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 4px solid #000;
  border-radius: var(--r-xl, 20px);
  padding: 24px;
  box-shadow: var(--shadow-lg, 8px 8px 0 #000);
  margin-bottom: 20px;
}
.prof-avatar-box {
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: 50%;
  border: 4px solid #000;
  background: var(--cyan, #00e5ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
  box-shadow: 4px 4px 0 #000;
  flex-shrink: 0;
}
.prof-header-info { flex: 1; min-width: 0; }
.prof-name {
  font-family: var(--font-heading, 'Bangers', cursive);
  font-size: clamp(22px, 5vw, 30px);
  letter-spacing: 2px;
  color: #000;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 4px;
  -webkit-text-stroke: 0.5px #000;
}
.prof-email {
  font-size: 13px;
  font-weight: 700;
  color: #444;
  word-break: break-all;
}

/* ── Section Label ── */
.prof-section-label {
  font-family: var(--font-heading, 'Bangers', cursive);
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #000;
  background: #000;
  color: #fff;
  display: inline-block;
  padding: 4px 16px;
  margin-bottom: 12px;
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--pink, #ff007f);
  transform: skewX(-8deg);
}

/* ── Info Grid ── */
.prof-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.prof-info-item {
  background: #fff;
  border: 3px solid #000;
  border-radius: var(--r-md, 8px);
  padding: 14px 16px;
  box-shadow: 4px 4px 0 #000;
}
.prof-info-full { grid-column: span 2; }
.prof-info-label {
  display: block;
  font-size: 10px;
  font-weight: 900;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.prof-info-val {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #000;
  word-break: break-all;
}

/* ── Action Buttons ── */
.prof-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}
.prof-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  font-family: var(--font-heading, 'Bangers', cursive);
  font-size: 18px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--tr, .18s ease);
  text-decoration: none;
  border: 4px solid #000;
  border-radius: var(--r-md, 8px);
  background: #fff;
  color: #000;
  box-shadow: 5px 5px 0 #000;
}
.prof-action-btn:hover { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #000; }
.prof-action-btn--edit {
  background: var(--cyan, #00e5ff);
}
.prof-action-btn--danger {
  background: var(--red, #e53935);
  color: #fff;
}

/* ── Guest Card ── */
.prof-guest-card {
  background: #fff;
  border: 4px solid #000;
  border-radius: var(--r-xl, 20px);
  padding: 56px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg, 8px 8px 0 #000);
}
.prof-guest-title {
  font-family: var(--font-heading, 'Bangers', cursive);
  font-size: clamp(24px, 5vw, 32px);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 12px;
}
.prof-guest-desc {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  line-height: 1.65;
  margin-bottom: 28px;
}

/* ── Edit Modal ── */
.prof-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.prof-modal-box {
  background: #fff;
  border: 4px solid #000;
  border-radius: var(--r-xl, 20px);
  padding: 32px 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: 10px 10px 0 #000;
}
.prof-modal-title {
  font-family: var(--font-heading, 'Bangers', cursive);
  font-size: 26px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #000;
  text-align: center;
  margin-bottom: 24px;
}
.prof-form-group { margin-bottom: 18px; }
.prof-form-label {
  display: block;
  font-size: 12px;
  font-weight: 900;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.prof-input {
  width: 100%;
  padding: 13px 16px;
  border: 3px solid #000;
  border-radius: var(--r-md, 8px);
  background: #f9f9f9;
  color: #000;
  font-size: 15px;
  font-family: inherit;
  font-weight: 700;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.prof-input:focus { outline: none; border-color: var(--pink, #ff007f); box-shadow: 3px 3px 0 var(--pink, #ff007f); }
.prof-file-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border: 3px dashed #000;
  border-radius: var(--r-md, 8px);
  background: var(--bg-base, #f9d924);
  color: #000;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-sizing: border-box;
  box-shadow: 3px 3px 0 #000;
}
.prof-file-btn:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.prof-file-name {
  font-size: 12px;
  font-weight: 700;
  color: #666;
  margin: 8px 0 0 4px;
}
.prof-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}
.prof-modal-btn {
  flex: 1;
  padding: 14px;
  font-family: var(--font-heading, 'Bangers', cursive);
  font-size: 18px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 3px solid #000;
  border-radius: var(--r-md, 8px);
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  color: #000;
  box-shadow: 4px 4px 0 #000;
}
.prof-modal-btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.prof-modal-btn--save { background: var(--cyan, #00e5ff); }

/* ── Tablet (≤768px) ── */
@media (max-width: 768px) {
  .prof-wrap { padding-left: 16px; padding-right: 16px; }
  .prof-header-card { padding: 18px; gap: 16px; }
  .prof-modal-box { padding: 24px 20px; }
}

/* ── Mobile (≤480px) ── */
@media (max-width: 480px) {
  .prof-wrap { padding-left: 12px; padding-right: 12px; }
  .prof-header-card { flex-direction: column; text-align: center; gap: 14px; }
  .prof-header-info { min-width: 0; width: 100%; }
  .prof-info-grid { grid-template-columns: 1fr; }
  .prof-info-full { grid-column: span 1; }
  .prof-guest-card { padding: 40px 16px; }
  .prof-modal-box { padding: 20px 16px; }
  .prof-action-btn { font-size: 16px; padding: 14px 16px; }
}

/* ── Desktop (≥1024px) ── */
@media (min-width: 1024px) {
  .prof-wrap { max-width: 580px; }
  .prof-header-card { padding: 28px 32px; }
  .prof-avatar-box { width: 96px; height: 96px; min-width: 96px; font-size: 42px; }
}




/* ── Multiplayer Photobooth (Neo-Brutalist) ── */
.mp-panel {
  background: #fff;
  border: 4px solid #000;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 6px 6px 0 #000;
  display: none; /* hidden by default */
  color: #000;
}
.mp-panel.active {
  display: block;
  animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.mp-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.mp-tab-btn {
  flex: 1;
  padding: 12px;
  font-family: var(--font-heading, 'Bangers', cursive);
  font-size: 18px;
  letter-spacing: 1px;
  background: #f1f5f9;
  border: 3px solid #000;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  transition: all 0.2s;
}
.mp-tab-btn.active {
  background: var(--pink, #f472b6);
  color: #000;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #000;
}

.mp-room-info {
  background: var(--yellow, #fde047);
  border: 3px solid #000;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 16px;
}
.mp-room-id {
  font-size: 28px;
  font-family: monospace;
  letter-spacing: 4px;
  margin: 8px 0;
  background: #fff;
  padding: 8px;
  border: 2px dashed #000;
}

.mp-input {
  width: 100%;
  padding: 12px;
  font-size: 18px;
  border: 3px solid #000;
  border-radius: 8px;
  margin-bottom: 12px;
  font-family: monospace;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 2px;
}

.mp-btn-action {
  width: 100%;
  padding: 14px;
  background: var(--cyan, #00e5ff);
  border: 3px solid #000;
  border-radius: 8px;
  font-family: var(--font-heading, 'Bangers', cursive);
  font-size: 20px;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  transition: all 0.2s;
}
.mp-btn-action:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.mp-status {
  text-align: center;
  font-weight: 700;
  margin-top: 12px;
  font-size: 14px;
  color: #333;
}

/* 2-Player: wrapper video — dikendalikan flex dari .cam-container */
.mp-video-wrap {
  position: relative;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: stretch;
  min-height: 0;
}
.mp-video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scaleX(-1);
}
.mp-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--pink, #f472b6);
  color: #000;
  font-weight: 900;
  padding: 4px 8px;
  border: 2px solid #000;
  border-radius: 4px;
  font-size: 12px;
}
.mp-badge.remote {
  background: var(--cyan, #00e5ff);
}

.mp-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.mp-overlay.show {
  opacity: 1;
}
.mp-overlay-content {
  background: var(--yellow, #fde047);
  padding: 40px;
  border: 6px solid #000;
  border-radius: 20px;
  box-shadow: 10px 10px 0 #000;
  text-align: center;
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.mp-overlay.show .mp-overlay-content {
  transform: scale(1);
}
.mp-overlay h2 {
  font-family: var(--font-heading, 'Bangers', cursive);
  font-size: 48px;
  margin: 0;
  color: #000;
  letter-spacing: 2px;
}
