/* ============================================
   yoyo's BAR - Shared Styles
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:            #0D0804;
  --bg-surface:    #1A1008;
  --bg-card:       #241810;
  --bg-input:      #2E1E12;
  --primary:       #C88A10;
  --primary-light: #F0B030;
  --primary-dark:  #8A5C08;
  --accent:        #E8C878;
  --text:          #F5EDD8;
  --text-muted:    #9A7D5A;
  --text-dim:      #6A5030;
  --border:        #3A2010;
  --border-light:  #5A3820;
  --stamp-on:      #F0B030;
  --stamp-off:     #2A1808;
  --success:       #56B85C;
  --danger:        #D9534F;
  --warning:       #F0AD4E;
  --info:          #5BC0DE;

  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --shadow: 0 4px 20px rgba(0,0,0,0.6);
  --glow:   0 0 24px rgba(200,138,16,0.35);
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography ---- */
h1 { font-size: 1.8rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { line-height: 1.6; }

/* ---- Layout Helpers ---- */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

.page {
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ---- Header ---- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,8,4,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-light);
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(26,16,8,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: color 0.2s;
  gap: 4px;
}

.nav-item.active,
.nav-item:hover {
  color: var(--primary-light);
}

.nav-item .nav-icon {
  font-size: 1.3rem;
  line-height: 1;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--r-md);
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #0D0804;
  box-shadow: var(--glow);
}

.btn-primary:hover { filter: brightness(1.1); }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover { border-color: var(--primary); }

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); border-color: var(--border-light); }

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: var(--r-sm);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

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

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
}

.form-control::placeholder {
  color: var(--text-dim);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239A7D5A' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.badge-gold   { background: linear-gradient(135deg, #B8750A, #F0B030); color: #0D0804; }
.badge-silver { background: linear-gradient(135deg, #6B7280, #9CA3AF); color: #0D0804; }
.badge-amber  { background: rgba(200,138,16,0.2); color: var(--primary-light); border: 1px solid var(--primary-dark); }
.badge-green  { background: rgba(86,184,92,0.2); color: var(--success); border: 1px solid rgba(86,184,92,0.4); }
.badge-red    { background: rgba(217,83,79,0.2); color: var(--danger); border: 1px solid rgba(217,83,79,0.4); }

/* ---- Level Colors ---- */
.level-1 { color: #9A8070; }
.level-2 { color: #6DA0CC; }
.level-3 { color: #9A9A9A; }
.level-4 { color: #F0B030; }
.level-5 { color: #E87070; }

/* ---- Loading ---- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  gap: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(90vw, 400px);
}

.toast {
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
  text-align: center;
}

.toast-success { background: var(--success); color: white; }
.toast-error   { background: var(--danger);  color: white; }
.toast-info    { background: var(--primary);  color: #0D0804; }

@keyframes toast-in  { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; } }

/* ---- Avatar ---- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  overflow: hidden;
  flex-shrink: 0;
}

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

/* ---- Divider ---- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ---- Section Title ---- */
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 16px 0 8px;
}

/* ---- Pulse Animation ---- */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.pulse { animation: pulse 2s ease infinite; }

/* ---- Glow Animation ---- */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(200,138,16,0.3); }
  50%       { box-shadow: 0 0 24px rgba(200,138,16,0.7); }
}
