:root {
  --bg-color: #0a0a0a;
  --text-color: #e0e0e0;
  --accent-color: #e25710;
  --accent-glow: #e2571080;
  --neon-blue: #e25710;
  --neon-purple: #e25710;
  --display-bg: #000000;
  --display-text: #e25710;
  --btn-bg: #1a1a1a;
  --btn-border: #2a2a2a;
  --btn-number: #2a2a2a;
  --btn-function: #333333;
  --btn-financial: #3a3a3a;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background: #0a0a0a;
  color: var(--text-color);
  font-family: 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
  padding: 1.5rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 320px;
  background: radial-gradient(ellipse at 50% 0%, rgba(226, 87, 16, 0.22) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.mouse-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.glow-blob {
  position: absolute;
  top: 0;
  left: 0;
  width: 720px;
  height: 720px;
  margin: -360px 0 0 -360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 87, 16, 0.38) 0%, rgba(226, 87, 16, 0.08) 42%, transparent 70%);
  will-change: transform;
}
.glow-blob-b {
  width: 480px;
  height: 480px;
  margin: -240px 0 0 -240px;
  background: radial-gradient(circle, rgba(226, 87, 16, 0.28) 0%, transparent 68%);
  opacity: 0.85;
}
@media (prefers-reduced-motion: reduce) {
  .mouse-glow { display: none; }
}
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 800px;
  background: #141414;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid #2a2a2a;
}
.site-header {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  max-width: 800px;
  margin-bottom: 1.5rem;
}
.logo {
  max-width: 180px;
  height: auto;
}
.logo-by {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #888;
}
.logo-by a {
  color: var(--accent-color);
  text-decoration: none;
}
.logo-by a:hover {
  text-decoration: underline;
}
.lang-switcher {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0 1.2rem;
}
.lang-btn,
.install-app {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  font-family: inherit;
}
.lang-btn {
  border: 1px solid transparent;
  background: #1a1a1a;
  color: #ccc;
  text-decoration: none;
}
.lang-btn:hover,
.lang-btn[aria-current="true"] {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}
.install-app {
  border: 1px solid #e25710;
  background: transparent;
  color: #e25710;
  cursor: pointer;
}
.install-app:hover {
  background: var(--accent-color);
  color: #fff;
}
.install-app.is-hidden {
  display: none;
}
h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #fff;
  font-weight: 700;
}
h1 .title-accent {
  color: #e25710;
}
.subtitle {
  color: #888;
  font-size: 0.95rem;
  margin-bottom: 0;
}
.calculator {
  background: #111111;
  border-radius: 15px;
  padding: 1.5rem;
  border: 2px solid var(--btn-border);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}
.display {
  background: var(--display-bg);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid #333;
  box-shadow: inset 0 0 15px rgba(226, 87, 16, 0.22);
  position: relative;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stack-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  color: var(--display-text);
  min-height: 1.5rem;
}
.stack-label {
  color: #666;
  font-size: 0.8rem;
  min-width: 30px;
}
.stack-value {
  text-align: right;
  flex: 1;
  word-break: break-all;
  text-shadow: 0 0 5px var(--display-text);
}
.stack-value.active {
  color: #fff;
  text-shadow: 0 0 10px #fff, 0 0 20px var(--display-text);
}
.mode-indicator {
  position: absolute;
  top: 5px;
  left: 10px;
  font-size: 0.7rem;
  color: var(--neon-blue);
  display: flex;
  gap: 0.5rem;
}
.mode-indicator span {
  background: var(--accent-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  color: #fff;
}
.keyboard {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}
.btn {
  padding: 0.8rem 0.3rem;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-color);
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
}
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--accent-glow);
}
.btn:active:not(:disabled) {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-number {
  background: var(--btn-number);
}
.btn-number:hover:not(:disabled) {
  background: #3d3d3d;
}
.btn-function {
  background: var(--btn-function);
  font-size: 0.75rem;
}
.btn-function:hover:not(:disabled) {
  background: #444444;
}
.btn-financial {
  background: var(--btn-financial);
  font-size: 0.75rem;
}
.btn-financial:hover:not(:disabled) {
  background: #4a4a4a;
}
.btn-enter {
  background: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-glow);
  color: #fff;
}
.btn-enter:hover:not(:disabled) {
  background: #c44a0e;
}
.btn-clear {
  background: #dc3545;
}
.btn-clear:hover:not(:disabled) {
  background: #bb2d3b;
}
.btn-shift {
  background: #ff8c00;
  color: #000;
}
.btn-shift.active {
  background: #ffcc00;
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}
.history-section {
  margin-top: 1.5rem;
  background: var(--btn-bg);
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid var(--btn-border);
}
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.history-title {
  font-size: 0.9rem;
  color: var(--neon-blue);
}
.history-clear {
  background: transparent;
  border: 1px solid var(--btn-border);
  color: var(--text-color);
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  min-width: auto;
}
.history-list {
  max-height: 150px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: var(--btn-border) var(--btn-bg);
}
.history-list::-webkit-scrollbar {
  width: 8px;
}
.history-list::-webkit-scrollbar-track {
  background: var(--btn-bg);
  border-radius: 4px;
}
.history-list::-webkit-scrollbar-thumb {
  background: var(--btn-border);
  border-radius: 4px;
}
.history-list::-webkit-scrollbar-thumb:hover {
  background: var(--neon-blue);
}
.history-item {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid #222;
}
.history-item:last-child {
  border-bottom: none;
}
.history-expression {
  color: #aaa;
}
.history-result {
  color: var(--display-text);
  font-weight: bold;
}
.copy-section {
  text-align: right;
  margin-bottom: 0.5rem;
  padding-right: 0.5rem;
}
#copy-hint {
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}
#copy-hint:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  padding-top: 1rem;
  border-top: 1px solid var(--btn-border);
}
.footer a {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.3s ease;
  text-shadow: 0 0 10px var(--accent-glow);
}
.footer a:hover {
  text-shadow: 0 0 20px var(--accent-glow);
}
.footer-links {
  margin-top: 0.6rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.disclaimer {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: #666;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.calculator-toggle {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.mode-btn {
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--text-color);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
}
.mode-btn.active {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}
.mode-btn:hover {
  border-color: var(--accent-color);
}
.font-size-control {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.font-size-control button {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--text-color);
  border-radius: 3px;
  cursor: pointer;
}
#font-size-display {
  min-width: 50px;
  text-align: center;
  color: var(--neon-blue);
  font-weight: bold;
}
.simple-calculator {
  display: none;
}
.simple-calculator.active {
  display: block;
}
.simple-screen {
  background: var(--display-bg);
  border-radius: 10px;
  padding: 0.55rem 1rem 0.85rem;
  margin-bottom: 1rem;
  border: 2px solid #333;
  box-shadow: inset 0 0 15px rgba(226, 87, 16, 0.22);
}
.simple-expr {
  min-height: 1.25rem;
  text-align: right;
  color: #e25710;
  opacity: 0.75;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.simple-display {
  background: transparent;
  color: var(--display-text);
  text-align: right;
  padding: 0;
  font-size: 2rem;
  font-family: 'Courier New', monospace;
  border: none;
  box-shadow: none;
  margin: 0;
  min-height: 2.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 5px var(--display-text);
}
.tvm-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.68rem;
  color: #c46a3a;
  font-family: 'Courier New', monospace;
  margin: 0.35rem 0 0.5rem;
  padding-top: 0.85rem;
}
.tvm-strip em {
  color: var(--display-text);
  font-style: normal;
  margin-left: 0.15rem;
}
.simple-keyboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.simple-keyboard .row {
  display: contents;
}
.simple-keyboard .btn {
  padding: 0.8rem 0.3rem;
  font-size: 0.95rem;
  min-height: 50px;
  background: var(--btn-number);
  color: var(--text-color);
  border: 1px solid var(--btn-border);
}
.simple-keyboard .btn:hover {
  background: #3d3d3d;
}
.simple-keyboard .btn[data-key="+"],
.simple-keyboard .btn[data-key="-"],
.simple-keyboard .btn[data-key="*"],
.simple-keyboard .btn[data-key="/"],
.simple-keyboard .btn[data-key="%"] {
  background: var(--btn-function);
}
.simple-keyboard .btn[data-key="="],
.simple-keyboard .btn[data-key="+/-"] {
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
  color: #fff;
}
.simple-keyboard .btn[data-key="C"] {
  background: #dc3545;
}
.simple-keyboard .btn[data-key="0"] {
  grid-column: span 2;
}
.simple-history-section {
  margin-top: 1rem;
  background: var(--btn-bg);
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid var(--btn-border);
}
.simple-history-section h3 {
  margin: 0 0 0.5rem 0;
  color: var(--neon-blue);
  font-size: 0.9rem;
}
.simple-history-list {
  max-height: 150px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: var(--btn-border) var(--btn-bg);
}
.simple-history-item {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid #222;
  color: #aaa;
}
.simple-history-item .result {
  color: var(--display-text);
  font-weight: bold;
}
.legal-page {
  max-width: 720px;
  line-height: 1.6;
}
.legal-page h1 {
  -webkit-text-fill-color: unset;
  background: none;
  color: var(--accent-color);
  font-size: 1.6rem;
}
.legal-page h2 {
  color: var(--neon-blue);
  font-size: 1.1rem;
  margin: 1.4rem 0 0.5rem;
}
.legal-page p,
.legal-page li {
  color: #ccc;
  margin-bottom: 0.7rem;
}
.legal-page ul {
  padding-left: 1.2rem;
  margin-bottom: 0.7rem;
}
.legal-page .back {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent-color);
}
.donate-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 800px;
  margin: 0 0 1.25rem;
  padding: 1.1rem 1.25rem;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem 1.25rem;
  align-items: center;
}
.donate-copy {
  min-width: 0;
  text-align: left;
}
.donate-copy h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
}
.donate-copy p {
  margin: 0;
  font-size: 0.85rem;
  color: #aaa;
}
.donate-goal {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #888;
}
.donate-bar {
  flex: 1;
  height: 6px;
  background: #2a2a2a;
  border-radius: 99px;
  overflow: hidden;
  min-width: 0;
}
.donate-bar-fill {
  height: 100%;
  width: 0;
  background: #e25710;
  border-radius: 99px;
  transition: width 0.6s ease;
}
.donate-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.donate-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid #e25710;
  background: transparent;
  color: #e25710;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.donate-btn:hover {
  background: #e25710;
  color: #fff;
}
.donate-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e25710;
}
.donate-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.donate-modal[hidden] {
  display: none;
}
.donate-modal-box {
  width: 100%;
  max-width: 420px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 1.35rem 1.25rem 1.15rem;
  position: relative;
  max-height: 90vh;
  overflow: auto;
}
.donate-modal-box h2 {
  margin: 0 1.5rem 0.35rem 0;
  font-size: 1.25rem;
  color: #fff;
  text-align: left;
}
.donate-modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.85rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.4rem;
  cursor: pointer;
}
.donate-modal-lead {
  margin: 0 0 0.9rem;
  color: #aaa;
  font-size: 0.9rem;
  text-align: left;
}
.donate-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}
.donate-amt {
  padding: 0.75rem 0.4rem;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: #ddd;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.donate-amt:hover,
.donate-amt.is-on {
  border-color: #e25710;
  color: #fff;
}
.donate-custom {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
}
.donate-coins {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: 0.2rem;
}
.donate-coin-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 0.3rem 0.55rem;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: #ccc;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.donate-coin-btn.is-on,
.donate-coin-btn:hover {
  border-color: #e25710;
  color: #fff;
}
.donate-coin-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
}
.donate-coin-btn.pix span:last-child {
  font-size: 0.65rem;
  text-align: center;
  line-height: 1.2;
}
.donate-coin-btn img.donate-coin-ico {
  border-radius: 7px;
}
.donate-continue {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 12px;
  background: #e25710;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 0.5rem;
}
.donate-continue:hover {
  background: #c44a0e;
}
.donate-dismiss {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 12px;
  background: #1a1a1a;
  color: #888;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.donate-qr {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 0.8rem;
  background: #fff;
  border-radius: 8px;
}
.donate-coin {
  text-align: center;
  color: #e25710;
  font-weight: 700;
  margin: 0 0 0.8rem;
}
.donate-field {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.6rem;
}
.donate-copy-row {
  display: flex;
  margin-top: 0.25rem;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
}
.donate-copy-row input {
  flex: 1;
  background: #0a0a0a;
  border: none;
  color: #fff;
  padding: 0.55rem;
  font-family: monospace;
  font-size: 0.8rem;
  min-width: 0;
}
.donate-copy-btn {
  border: none;
  border-left: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: #e25710;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.7rem;
}
.donate-hint {
  font-size: 0.75rem;
  color: #888;
  margin: 0.4rem 0 0.8rem;
}
.donate-thanks {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}
.donate-thanks-ico {
  font-size: 2.4rem;
  margin: 0 0 0.6rem;
}
.donate-thanks-msg {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 1.1rem;
  line-height: 1.4;
}
@media (max-width: 600px) {
  .container { padding: 1rem; }
  h1 { font-size: 1.5rem; }
  .keyboard { gap: 0.3rem; }
  .btn { padding: 0.6rem 0.2rem; font-size: 0.75rem; min-height: 45px; }
  .stack-value { font-size: 0.9rem; }
  .donate-card {
    grid-template-columns: 1fr;
  }
  .donate-action {
    align-items: stretch;
  }
}
