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

:root {
  --bg: #14100d;
  --bg-panel: #1e1712;
  --bg-card: #241b14;
  --border: #3a2c1e;
  --text: #f1e7d8;
  --text-dim: #a89684;
  --accent: #d99a3f;
  --accent-2: #c97b2e;
  --hp: #e5484d;
  --stamina: #f5a623;
  --mana: #4d9de5;
  --success: #5cb85c;
  --danger: #e5484d;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at top, #241b14 0%, #14100d 60%);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

h1, h2, h3 {
  font-family: 'Cinzel', serif;
  margin: 0;
  letter-spacing: 0.02em;
}

header.hero {
  text-align: center;
  padding: 18px 0 22px;
}

header.hero .name {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 2px 12px rgba(217, 154, 63, 0.35);
}

header.hero .title {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 15px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.stat-block {
  margin-bottom: 18px;
}

.stat-block:last-child {
  margin-bottom: 0;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.stat-row .label {
  font-weight: 600;
  font-size: 15px;
}

.stat-row .value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
}

.bar-track {
  height: 16px;
  background: #0f0b08;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}

.defi-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.defi-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.defi-item .text {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.defi-item .penalty {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.defi-item .reward {
  font-size: 12px;
  color: var(--success);
  margin-bottom: 10px;
}

.defi-photo-link {
  display: block;
  margin-bottom: 10px;
}

.defi-photo {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

.photo-caption {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  margin-bottom: 10px;
}

input[type="file"].visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

button.photo-btn {
  width: 100%;
  background: var(--bg-panel);
  border: 1px dashed var(--border);
  color: var(--text);
  margin-bottom: 10px;
}

.defi-actions {
  display: flex;
  gap: 10px;
}

.defi-status {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
}

.defi-status.success { color: var(--success); }
.defi-status.failed { color: var(--danger); }

button {
  font-family: inherit;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s, filter 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

button:active {
  transform: scale(0.96);
}

button.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #1a1208;
}

button.success {
  background: var(--success);
  color: #0d1f0d;
  flex: 1;
}

button.danger {
  background: var(--danger);
  color: #250b0c;
  flex: 1;
}

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

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

button.small {
  padding: 8px 12px;
  font-size: 13px;
}

.stat-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.log-item {
  font-size: 13px;
  color: var(--text-dim);
  border-left: 2px solid var(--border);
  padding-left: 10px;
}

.log-item time {
  display: block;
  font-size: 11px;
  opacity: 0.7;
}

.empty {
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}

input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 1px solid var(--accent);
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.row {
  display: flex;
  gap: 10px;
}

.row > * {
  flex: 1;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  margin-left: 8px;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

nav.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

nav.tabs button {
  flex: 1;
}
