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

:root {
  --accent: #ff7a1a;
  --accent-soft: rgba(255, 122, 26, .16);
  --accent-glow: rgba(255, 122, 26, .32);
  --bg: #000000;
  --panel: #08080a;
  --panel-2: #0d0d10;
  --hover: #131317;
  --line: #17171c;
  --line-2: #232329;
  --txt: #ededf2;
  --txt-dim: #8b8b95;
  --txt-mut: #5c5c66;
  --green: #34d399;
  --cyan: #38d6c4;
  --blue: #5aa2ff;
  --red: #f4607a;
  --yellow: #f5c451;
  --orange: #f59e42;
  --violet: #ff9d5c;
  --r: 14px;
  --r2: 10px;
  --mono: 'SF Mono', 'Cascadia Code', Consolas, monospace;
}

/* Body & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
}

::-webkit-scrollbar {
  display: none;
}
* {
  scrollbar-width: none;
}

a, button, [role="button"], input, select, textarea, .tab, .mbtn, .toggle, .lbtn, .mini, .cs-trigger, .cs-opt {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
}

select.enhanced {
  display: none !important;
}

/* App Layout */
.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: max(12px, env(safe-area-inset-top)) 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
}

.app-header .brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.app-header .brand-ico {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}

.app-header .brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--txt);
}

.app-header .status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  color: var(--txt-dim);
}

.app-header .status-pill.running {
  background: rgba(52,211,153,0.15);
  color: var(--green);
}

/* View System */
.views-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: calc(max(12px, env(safe-area-inset-top)) + 52px) 0 calc(76px + max(12px, env(safe-area-inset-bottom)));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, visibility 0s .25s;
}

.view.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity .25s ease, transform .25s ease, visibility 0s 0s;
}

.view-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 0 20px;
}

/* Bottom Tab Bar */
.tab-bar {
  position: fixed;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 420px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  border-radius: 32px;
  background: rgba(18, 18, 20, 0.82);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 0.5px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  z-index: 200;
  contain: layout paint style;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  min-width: 56px;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.tab:active {
  transform: scale(0.88);
  transition-duration: 0.06s;
}

.tab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt-mut);
  transition: color .2s ease, transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-icon svg {
  width: 22px;
  height: 22px;
}

.tab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--txt-mut);
  transition: color .2s ease;
}

.tab.active .tab-icon,
.tab.active .tab-label {
  color: var(--accent);
}

.tab.active .tab-icon {
  transform: scale(1.08);
}

.tab .tab-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--accent);
  color: #1a0f04;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0);
  transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab .tab-badge.show {
  transform: scale(1);
}

/* Dashboard View - Status Card */
.status-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.status-card .status-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--txt-mut);
  flex-shrink: 0;
  transition: background .3s, box-shadow .3s;
}

.live-dot.on {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.4s infinite;
}

.live-dot.done {
  background: var(--blue);
}

.status-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--txt);
}

.status-sub {
  font-size: 13px;
  font-weight: 450;
  color: var(--txt-dim);
  margin-top: 2px;
}

.status-btns {
  display: flex;
  gap: 8px;
}

/* Buttons */
.mbtn {
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--txt);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), background .14s, border-color .14s;
}

.mbtn:active {
  transform: scale(0.95);
  transition-duration: 0.06s;
}

.mbtn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a0f04;
  font-weight: 700;
}

.mbtn.primary:active {
  background: #ff8f3a;
}

.mbtn.danger {
  border-color: rgba(244, 96, 122, 0.4);
  color: var(--red);
}

.mbtn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Metric Grid */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.metric {
  background: var(--bg);
  padding: 18px 16px;
}

.metric-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--txt-dim);
  margin-bottom: 6px;
}

.metric-val {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--txt);
}

.metric-val.green {
  color: var(--green);
}

.metric-foot {
  font-size: 11.5px;
  font-weight: 450;
  color: var(--txt-mut);
  margin-top: 2px;
}

/* Progress Bar */
.progress-wrap {
  margin-bottom: 20px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--txt-dim);
  margin-bottom: 8px;
}

.progress-head b {
  font-weight: 600;
  color: var(--txt);
}

.progress {
  height: 5px;
  background: var(--panel-2);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 5px;
  transition: width .4s ease;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Category Breakdown */
.cat-section {
  margin-bottom: 20px;
}

.cat-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 14px 0 8px;
  color: var(--accent);
}

.cat-head.green { color: var(--green); }
.cat-head.violet { color: var(--violet); }
.cat-head.red { color: var(--red); }

.cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--txt-dim);
}

.cat-row b {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--txt);
}

/* Color utility classes */
.accent { color: var(--accent); }
.green { color: var(--green); }
.cyan { color: var(--cyan); }
.blue { color: var(--blue); }
.red { color: var(--red); }
.yellow { color: var(--yellow); }
.violet { color: var(--violet); }
.dim { color: var(--txt-mut); }

/* Config View */
.sec-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--txt-mut);
  padding: 22px 2px 8px;
}

.list {
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--line);
  font-size: 14px;
  color: var(--txt-dim);
}

.li:last-child {
  border-bottom: none;
}

.li b {
  font-weight: 600;
  color: var(--txt);
}

.li.col {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

input[type=number], input[type=text] {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--txt);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  width: 80px;
  outline: none;
  transition: border-color .14s;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.inp-full {
  width: 100%;
  text-align: left;
}

.paste-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--txt-dim);
}

.paste-area {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--txt);
  padding: 12px 14px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  resize: none;
  outline: none;
  transition: border-color .14s;
  -webkit-overflow-scrolling: touch;
}

.paste-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.paste-area::placeholder {
  color: var(--txt-mut);
  opacity: 0.6;
}

.toggle {
  width: 44px;
  height: 26px;
  border-radius: 20px;
  background: var(--line-2);
  position: relative;
  cursor: pointer;
  transition: background .18s;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #6a6a72;
  transition: all .18s cubic-bezier(0.32, 0.72, 0, 1);
}

.toggle.on {
  background: var(--accent);
}

.toggle.on::after {
  left: 21px;
  background: #fff;
}

.lbtn {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--txt);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  max-width: 180px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  transition: border-color .14s;
}

.lbtn:active {
  transform: scale(0.97);
  transition-duration: 0.06s;
}

.sec-actions {
  padding: 20px 2px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.savenote {
  font-size: 13px;
  color: var(--green);
  opacity: 0;
  transition: opacity .2s;
}

.savenote.show {
  opacity: 1;
}

/* Custom Select Dropdown */
.cs {
  position: relative;
}

.cs-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--txt);
  cursor: pointer;
  min-width: 120px;
  transition: border-color .14s;
}

.cs.open .cs-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cs-chev {
  width: 14px;
  height: 14px;
  color: var(--txt-mut);
  margin-left: auto;
  transition: transform .22s ease;
}

.cs.open .cs-chev {
  transform: rotate(180deg);
}

.cs-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #0f0f14;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 16px 40px rgba(0,0,0,.65);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transform-origin: bottom right;
  pointer-events: none;
  transition: .17s cubic-bezier(.34, 1.5, .64, 1);
  z-index: 300;
}

.cs.open .cs-menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.cs-opt {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--txt-dim);
  cursor: pointer;
  transition: background .12s;
}

.cs-opt:active {
  background: var(--hover);
}

.cs-opt.sel {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.cs-opt.sel::after {
  content: ' \2713';
  font-size: 12px;
}

/* Hits View */
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 14px;
  font-size: 14px;
  color: var(--txt-dim);
}

.list-head b {
  font-weight: 700;
}

.mini {
  padding: 6px 16px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--txt-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mini:active {
  transform: scale(0.95);
  transition-duration: 0.06s;
}

.hits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hit-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.hit-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.hit-ico.v {
  background: rgba(255,122,26,.14);
  color: var(--violet);
}

.hit-ico.g {
  background: rgba(52,211,153,.14);
  color: var(--green);
}

.hit-ico.o {
  background: rgba(245,158,66,.14);
  color: var(--orange);
}

.hit-body {
  flex: 1;
  min-width: 0;
}

.hit-combo {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--txt);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12.5px;
}

.hit-meta .k {
  color: var(--txt-mut);
}

.hit-meta .val {
  font-weight: 600;
}

.empty {
  text-align: center;
  color: var(--txt-mut);
  padding: 60px 20px;
  font-size: 14px;
}

/* Logs View */
.logs {
  font-family: var(--mono);
  font-size: 13px;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 4px 0;
  text-rendering: optimizeSpeed;
}

.log-row {
  display: flex;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  align-items: baseline;
  font-size: 12.5px;
}

.log-row:active {
  background: var(--panel-2);
}

.log-time {
  color: var(--txt-mut);
  flex-shrink: 0;
  font-size: 11.5px;
}

.log-stat {
  font-weight: 700;
  flex-shrink: 0;
  min-width: 70px;
  font-size: 11.5px;
  text-transform: uppercase;
}

/* Status color classes */
.s-valid, .s-hit, .s-java, .s-gp_ult, .s-giftcode, .s-rewards { color: var(--green); }
.s-bedrock, .s-gp_pc { color: var(--cyan); }
.s-bad, .s-invalid { color: var(--red); }
.s-2fa { color: var(--blue); }
.s-limit, .s-ratelimit, .s-other { color: var(--yellow); }
.s-error, .s-promo { color: var(--violet); }

.log-msg {
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
}

.head-btns {
  display: flex;
  gap: 6px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: calc(76px + max(16px, env(safe-area-inset-bottom)));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--txt);
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s, transform .24s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 500;
  box-shadow: 0 12px 40px rgba(0,0,0,.7);
  max-width: calc(100% - 48px);
}

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

.toast.ok {
  border-color: rgba(52,211,153,.5);
}

.toast.err {
  border-color: rgba(244,96,122,.5);
  color: var(--red);
}

/* Keyframe Animations */
@keyframes pulse { 
  0%, 100% { opacity: 1; } 
  50% { opacity: .35; } 
}

@keyframes fadeIn { 
  from { opacity: 0; transform: translateY(6px); } 
  to { opacity: 1; transform: none; } 
}
