/* ============================================================
   MySushiCount — app.css
   Paleta: preto + vermelho #C8202A + laranja #E8621A
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:          #C8202A;
  --red-dark:     #A01820;
  --red-dim:      rgba(200, 32, 42, 0.15);
  --orange:       #E8621A;
  --orange-dim:   rgba(232, 98, 26, 0.15);
  --bg:           #0F0F0F;
  --bg2:          #1A1A1A;
  --bg3:          #242424;
  --bg4:          #2E2E2E;
  --white:        #FFFFFF;
  --text:         #F0F0F0;
  --text-muted:   #888888;
  --border:       #2E2E2E;
  --font:         'Plus Jakarta Sans', sans-serif;
  --radius:       14px;
  --radius-sm:    10px;
  --radius-full:  999px;
  --nav-h:        56px;
  --bnav-h:       64px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  min-height:  100vh;
  padding-bottom: var(--bnav-h);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: var(--font); cursor: pointer; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }

/* ── Top nav ──────────────────────────────────────────────── */
.app-nav {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         0 16px;
  height:          var(--nav-h);
  background:      var(--bg);
  border-bottom:   1px solid var(--border);
  position:        sticky;
  top:             0;
  z-index:         100;
}

.nav-logo {
  font-size:   18px;
  font-weight: 800;
  color:       var(--red);
  letter-spacing: -.3px;
}

.nav-right { display: flex; align-items: center; gap: 10px; }

.btn-nav-create {
  background:    var(--red);
  color:         white;
  border:        none;
  border-radius: var(--radius-full);
  padding:       7px 14px;
  font-size:     13px;
  font-weight:   700;
}

.btn-nav-login {
  color:       var(--orange);
  font-size:   13px;
  font-weight: 700;
  border:      1px solid var(--orange);
  border-radius: var(--radius-full);
  padding:     7px 14px;
}

.nav-avatar {
  width:         34px;
  height:        34px;
  border-radius: 50%;
  overflow:      hidden;
  border:        2px solid var(--red);
  display:       flex;
  align-items:   center;
  justify-content: center;
  background:    var(--bg3);
  font-size:     13px;
  font-weight:   800;
  color:         var(--red);
}

.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Selector de língua ───────────────────────────────────── */
.lang-selector { position: relative; }

.lang-current {
  background:    var(--bg3);
  color:         var(--text-muted);
  border:        1px solid var(--border);
  border-radius: var(--radius-full);
  padding:       6px 10px;
  font-size:     12px;
  font-weight:   600;
}

.lang-dropdown {
  display:       none;
  position:      absolute;
  right:         0;
  top:           calc(100% + 6px);
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width:     100px;
  z-index:       200;
  overflow:      hidden;
}

.lang-selector.open .lang-dropdown { display: block; }

.lang-dropdown a {
  display:     block;
  padding:     8px 14px;
  font-size:   13px;
  color:       var(--text-muted);
  transition:  background .1s;
}

.lang-dropdown a:hover { background: var(--bg3); color: var(--text); }
.lang-dropdown a.active { color: var(--orange); font-weight: 700; }

/* ── Bottom nav ───────────────────────────────────────────── */
.bottom-nav {
  display:         flex;
  position:        fixed;
  bottom:          0;
  left:            0;
  right:           0;
  height:          var(--bnav-h);
  background:      var(--bg);
  border-top:      1px solid var(--border);
  z-index:         100;
  padding-bottom:  env(safe-area-inset-bottom);
}

.bnav-item {
  flex:            1;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  gap:             3px;
  color:           var(--text-muted);
  font-size:       10px;
  font-weight:     600;
  transition:      color .15s;
}

.bnav-item svg { width: 22px; height: 22px; }
.bnav-item.active { color: var(--orange); }

/* ── Hero com kanji ───────────────────────────────────────── */
.hero-red {
  background: var(--red);
  padding:    28px 20px 24px;
  text-align: center;
  position:   relative;
  overflow:   hidden;
}

.hero-red .kanji {
  position:    absolute;
  font-weight: 900;
  color:       rgba(255,255,255,.08);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.hero-red .kanji-1 { font-size: 130px; top: -20px; right: -15px; }
.hero-red .kanji-2 { font-size: 90px;  top:  15px; left:  -12px; }

.hero-logo {
  font-size:   22px;
  font-weight: 800;
  color:       white;
  position:    relative;
  z-index:     1;
  letter-spacing: -.3px;
}

.hero-tagline {
  font-size:   12px;
  color:       rgba(255,255,255,.75);
  margin-top:  4px;
  position:    relative;
  z-index:     1;
}

.hero-big {
  font-size:   30px;
  font-weight: 800;
  color:       white;
  line-height: 1.2;
  margin:      14px 0 6px;
  position:    relative;
  z-index:     1;
}

.hero-sub {
  font-size:  12px;
  color:      rgba(255,255,255,.7);
  position:   relative;
  z-index:    1;
}

/* ── Botões ───────────────────────────────────────────────── */
.btn {
  display:       block;
  width:         100%;
  padding:       14px;
  border-radius: var(--radius);
  font-size:     14px;
  font-weight:   700;
  text-align:    center;
  border:        none;
  transition:    transform .1s, opacity .1s;
}

.btn:active { transform: scale(.98); opacity: .9; }

.btn-primary   { background: var(--red);    color: white; }
.btn-secondary { background: transparent;   color: var(--orange); border: 1.5px solid var(--orange); }
.btn-dark      { background: var(--bg3);    color: var(--text);   border: 1px solid var(--border); }
.btn-google    { background: var(--bg3);    color: var(--text);   border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-danger    { background: var(--red);    color: white; }
.btn-sm        { padding: 9px 16px; font-size: 13px; width: auto; display: inline-block; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       16px;
}

.card-red {
  background:    var(--red-dim);
  border:        1px solid var(--red);
  border-radius: var(--radius);
  padding:       16px;
}

/* ── Inputs ───────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-label {
  display:     block;
  font-size:   13px;
  font-weight: 600;
  color:       var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width:         100%;
  background:    var(--bg3);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  color:         var(--text);
  font-family:   var(--font);
  font-size:     15px;
  padding:       12px 14px;
  outline:       none;
  transition:    border-color .15s;
}

.form-input:focus   { border-color: var(--red); }
.form-input::placeholder { color: var(--text-muted); }

.form-error {
  font-size:  12px;
  color:      #FF6B6B;
  margin-top: 4px;
}

/* ── Section title ────────────────────────────────────────── */
.section-title {
  font-size:      11px;
  font-weight:    700;
  color:          var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding:        14px 16px 8px;
}

/* ── Botões de contagem ───────────────────────────────────── */
.count-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap:     12px;
  padding: 16px;
}

.count-btn {
  border:        none;
  border-radius: 20px;
  padding:       20px 12px;
  display:       flex;
  flex-direction: column;
  align-items:   center;
  gap:           4px;
  transition:    transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.count-btn:active { transform: scale(.95); }

.count-btn.sushi   { background: var(--red); color: white; }
.count-btn.sashimi { background: var(--bg3); color: var(--orange); border: 2px solid var(--orange); }

.count-btn .count-icon  { font-size: 34px; line-height: 1; }
.count-btn .count-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.count-btn .count-num   { font-size: 28px; font-weight: 800; margin-top: 2px; }

/* ── Total box ────────────────────────────────────────────── */
.total-box {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  background:      var(--bg2);
  border:          1px solid var(--border);
  border-radius:   var(--radius);
  padding:         14px 16px;
  margin:          0 16px 12px;
}

.total-num   { font-size: 32px; font-weight: 800; color: var(--white); }
.total-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }

.record-badge {
  background:    var(--orange);
  color:         white;
  border-radius: var(--radius-full);
  padding:       4px 10px;
  font-size:     10px;
  font-weight:   700;
  display:       inline-block;
}

.record-new {
  background: var(--red);
  animation:  pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .7; }
}

/* ── Leaderboard ──────────────────────────────────────────── */
.player-row {
  display:     flex;
  align-items: center;
  gap:         8px;
  padding:     7px 16px;
}

.player-rank {
  width:           18px;
  height:          18px;
  border-radius:   50%;
  font-size:       9px;
  font-weight:     800;
  display:         flex;
  align-items:     center;
  justify-content: center;
  flex-shrink:     0;
}

.rank-1 { background: #FFD700; color: #5A3A00; }
.rank-2 { background: #999;    color: #1A1A1A; }
.rank-3 { background: #8B5A2B; color: white;   }
.rank-n { background: var(--bg4); color: var(--text-muted); }

.player-avatar {
  width:         28px;
  height:        28px;
  border-radius: 50%;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     11px;
  font-weight:   800;
  flex-shrink:   0;
  overflow:      hidden;
}

.player-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-red    { background: var(--red);    color: white; }
.avatar-orange { background: var(--orange); color: white; }
.avatar-gray   { background: var(--bg4);    color: var(--text-muted); }

.player-name  { font-size: 12px; font-weight: 700; color: var(--text); flex: 1; }
.player-score { font-size: 13px; font-weight: 800; color: var(--orange); }

.score-bar-bg { flex: 1; height: 4px; background: var(--bg4); border-radius: 2px; margin: 0 6px; }
.score-bar-fill { height: 4px; background: var(--orange); border-radius: 2px; transition: width .4s ease; }

/* ── Photo strip ──────────────────────────────────────────── */
.photo-strip {
  display:    flex;
  gap:        8px;
  padding:    4px 16px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.photo-strip::-webkit-scrollbar { display: none; }

.photo-thumb {
  width:         60px;
  height:        60px;
  border-radius: var(--radius-sm);
  background:    var(--bg3);
  border:        1px solid var(--border);
  object-fit:    cover;
  flex-shrink:   0;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     20px;
  overflow:      hidden;
}

.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.photo-add {
  width:         60px;
  height:        60px;
  border-radius: var(--radius-sm);
  border:        1.5px dashed var(--orange);
  display:       flex;
  align-items:   center;
  justify-content: center;
  flex-shrink:   0;
  cursor:        pointer;
  color:         var(--orange);
  font-size:     24px;
  transition:    background .15s;
}

.photo-add:hover { background: var(--orange-dim); }

/* ── Stats grid ───────────────────────────────────────────── */
.stats-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   8px;
  padding:               12px 16px;
}

.stat-card {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  padding:       10px 8px;
  text-align:    center;
}

.stat-num   { font-size: 20px; font-weight: 800; color: var(--orange); }
.stat-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-top: 2px; }

/* ── History items ────────────────────────────────────────── */
.history-item {
  display:     flex;
  align-items: center;
  gap:         10px;
  padding:     10px 16px;
  border-bottom: 1px solid var(--border);
  transition:  background .1s;
}

.history-item:hover { background: var(--bg2); }

.history-icon {
  width:         36px;
  height:        36px;
  border-radius: var(--radius-sm);
  background:    var(--bg3);
  border:        1px solid var(--border);
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     16px;
  flex-shrink:   0;
}

.history-info { flex: 1; }
.history-name { font-size: 13px; font-weight: 700; color: var(--text); }
.history-date { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.history-score { font-size: 16px; font-weight: 800; color: var(--orange); }

/* ── Profile header ───────────────────────────────────────── */
.profile-header {
  background: var(--red);
  padding:    24px 20px 20px;
  text-align: center;
  position:   relative;
  overflow:   hidden;
}

.profile-header .kanji {
  position:    absolute;
  font-weight: 900;
  color:       rgba(255,255,255,.08);
  user-select: none;
  pointer-events: none;
}

.profile-av-wrap {
  width:         70px;
  height:        70px;
  border-radius: 50%;
  background:    white;
  margin:        0 auto 10px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     26px;
  font-weight:   800;
  color:         var(--red);
  overflow:      hidden;
  position:      relative;
  z-index:       1;
  border:        3px solid rgba(255,255,255,.3);
}

.profile-av-wrap img { width: 100%; height: 100%; object-fit: cover; }

.profile-name   { font-size: 16px; font-weight: 800; color: white; position: relative; z-index: 1; }
.profile-handle { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 2px; position: relative; z-index: 1; }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  display:     flex;
  align-items: center;
  gap:         10px;
  padding:     10px 16px;
  color:       var(--text-muted);
  font-size:   12px;
  font-weight: 600;
}

.divider::before,
.divider::after {
  content:    '';
  flex:       1;
  height:     1px;
  background: var(--border);
}

/* ── Toast / notificações ─────────────────────────────────── */
.toast {
  position:      fixed;
  bottom:        calc(var(--bnav-h) + 12px);
  left:          50%;
  transform:     translateX(-50%);
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       12px 20px;
  font-size:     13px;
  font-weight:   600;
  color:         var(--text);
  z-index:       500;
  white-space:   nowrap;
  animation:     toast-in .2s ease;
}

.toast.success { border-color: var(--orange); color: var(--orange); }
.toast.error   { border-color: var(--red);    color: #FF6B6B; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Ads ──────────────────────────────────────────────────── */
.ad-slot {
  background:    var(--bg2);
  border-top:    1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding:       8px 16px;
  text-align:    center;
  font-size:     11px;
  color:         var(--text-muted);
  min-height:    60px;
  display:       flex;
  align-items:   center;
  justify-content: center;
}

/* ── Utilitários ──────────────────────────────────────────── */
.container  { max-width: 480px; margin: 0 auto; padding: 0 16px; }
.mt-1       { margin-top: 8px; }
.mt-2       { margin-top: 16px; }
.mt-3       { margin-top: 24px; }
.mb-1       { margin-bottom: 8px; }
.mb-2       { margin-bottom: 16px; }
.p-page     { padding: 20px 16px; }
.text-muted { color: var(--text-muted); }
.text-orange{ color: var(--orange); }
.text-red   { color: var(--red); }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 11px; }
.fw-bold    { font-weight: 700; }
.fw-black   { font-weight: 800; }
.text-center{ text-align: center; }

/* ── Features cards (homepage) ────────────────────────────── */
.feat-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   8px;
  padding:               16px;
}

.feat-card {
  background:    var(--bg2);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  padding:       12px 8px;
  text-align:    center;
}

.feat-icon { font-size: 22px; margin-bottom: 5px; color: var(--orange); }
.feat-text { font-size: 11px; font-weight: 700; color: var(--text); }
.feat-sub  { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (min-width: 480px) {
  body { max-width: 480px; margin: 0 auto; }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
