@import url("./tokens.css");


/* =====================================
   DRAGON KINGDOM - RESOURCE CALCULATOR
   ===================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 25px 16px;
  background:
    radial-gradient(circle at top, #3b170f, #100907 65%);
  color: #fff3e5;
  font-family: Arial, sans-serif;
}

/* CONTAINER */

.container {
  width: 100%;
  max-width: 720px;
  margin: 25px auto;
}

/* BACK BUTTON */

.back {
  display: inline-block;
  color: #e6b85c;
  text-decoration: none;
  font-weight: bold;
  margin-bottom: 22px;
  transition: color .2s ease;
}

.back:hover {
  color: #fff0bd;
}

/* MAIN PANEL */

.panel {
  background: rgba(28, 25, 43, .97);
  border: 1px solid #69502d;
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 15px 45px #0008;
}

/* TITLE */

h1 {
  text-align: center;
  color: #f2c46d;
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: .5px;
}

.subtitle {
  text-align: center;
  color: #bcb5ca;
  line-height: 1.7;
  margin-bottom: 28px;
  font-size: 14px;
}

/* LABEL */

label {
  display: block;
  margin: 18px 0 8px;
  font-weight: bold;
  color: #f1e9ff;
}

/* INPUT AND SELECT */

select,
input {
  width: 100%;
  padding: 13px;
  border-radius: 9px;
  border: 1px solid #625476;
  background: #171525;
  color: white;
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

select:focus,
input:focus {
  border-color: #e6b85c;
  box-shadow: 0 0 0 3px #e6b85c20;
}

/* TAX DISPLAY */

.tax-info {
  margin-top: 18px;
  padding: 17px;
  background: linear-gradient(135deg, #352b20, #292131);
  border: 1px solid #8b6836;
  border-radius: 10px;
  text-align: center;
  color: #e6d5b6;
}

.tax-info strong {
  display: block;
  color: #f5c76e;
  font-size: 29px;
  margin-top: 5px;
}

/* RESOURCE GRID */

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 15px;
}

/* RESOURCE CARD */

.resource-card {
  padding: 14px;
  background: linear-gradient(145deg, #211e32, #191727);
  border: 1px solid #51445f;
  border-radius: 12px;
  min-width: 0;
  transition: border-color .2s, transform .2s;
}

.resource-card:hover {
  border-color: #a47c45;
  transform: translateY(-2px);
}

.resource-card label {
  margin: 0 0 10px;
  color: #f2c46d;
  font-size: 15px;
}

.resource-card input {
  font-weight: bold;
  letter-spacing: .3px;
}

/* QUICK ADD BUTTONS */

.quick-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 10px;
}

button {
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #e7bd65, #a66b27);
  color: #211609;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  padding: 11px 3px;
  transition: filter .2s, transform .2s;
}

button:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

button:active {
  transform: scale(.97);
}

/* CLEAR BUTTON */

.clear-button {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  background: linear-gradient(135deg, #82434b, #572c35);
  color: white;
  border: 1px solid #a45a63;
  font-size: 14px;
}

/* CALCULATE BUTTON */

.calculate-button {
  width: 100%;
  padding: 16px;
  margin-top: 12px;
  font-size: 15px;
  letter-spacing: .5px;
}

/* RESULT PANEL */

.result {
  display: none;
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(145deg, #172e27, #192a28);
  border: 1px solid #438b65;
  line-height: 1.7;
  animation: resultAppear .35s ease;
}

.result h2 {
  margin-top: 0;
  color: #8ee0a9;
  font-size: 21px;
}

.result h3 {
  color: #f5c76e;
  margin-bottom: 8px;
  font-size: 16px;
}

/* RESOURCE DETAIL */

.detail-card {
  padding: 15px 0;
  border-bottom: 1px solid #ffffff25;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 7px 0;
  font-size: 14px;
}

.detail-row span {
  color: #c8c3d0;
}

.detail-row strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.net {
  color: #8ee0a9;
}

.tax {
  color: #ffaaa1;
}

/* TOTAL CARD */

.total-card {
  margin-top: 20px;
  padding: 17px;
  background: #263e31;
  border: 1px solid #438b65;
  border-radius: 10px;
}

.total-card strong {
  display: block;
  font-size: 23px;
  color: #8ee0a9;
  overflow-wrap: anywhere;
}

.total-card > div:not(:first-child) {
  margin-top: 12px;
}

/* GRAPH */

.graph-title {
  color: #f5c76e;
  font-size: 17px;
  font-weight: bold;
  margin-top: 27px;
  padding-top: 20px;
  border-top: 1px solid #ffffff25;
}

.graph-row {
  margin-top: 18px;
}

.graph-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}

.graph-label b {
  text-align: right;
  overflow-wrap: anywhere;
}

.graph-track {
  height: 17px;
  background: #ffffff18;
  border-radius: 20px;
  overflow: hidden;
}

.graph-bar {
  height: 100%;
  width: 0;
  border-radius: 20px;
  transition: width .6s ease;
}

.gross-bar {
  background: linear-gradient(90deg, #c18c39, #f5d27f);
}

.tax-bar {
  background: linear-gradient(90deg, #a94d4d, #f18c80);
}

.net-bar {
  background: linear-gradient(90deg, #348c60, #83df9d);
}

/* NOTE */

.note {
  color: #bcb5ca;
  font-size: 12px;
  line-height: 1.7;
  margin-top: 22px;
}

/* FOOTER */

footer {
  text-align: center;
  color: #898197;
  margin-top: 25px;
  font-size: 13px;
  letter-spacing: .5px;
}

/* ANIMATION */

@keyframes resultAppear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* TABLET */

@media (max-width: 600px) {
  body {
    padding: 18px 12px;
  }

  .container {
    margin: 12px auto;
  }

  .panel {
    padding: 20px;
  }

  h1 {
    font-size: 24px;
  }
}

/* MOBILE */

@media (max-width: 400px) {
  .panel {
    padding: 15px;
  }

  .resource-grid {
    gap: 9px;
  }

  .resource-card {
    padding: 9px;
  }

  .resource-card label {
    font-size: 13px;
  }

  .quick-buttons {
    gap: 3px;
  }

  .quick-buttons button {
    font-size: 9px;
    padding: 10px 2px;
  }

  .detail-row {
    font-size: 12px;
  }

  .result-value,
  .total-card strong {
    font-size: 20px;
  }
}

/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}


/* CRIMSON ROYAL THEME */
600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');
:root { color-scheme: dark; --gold:#e9c98a; --red:#a8122a; --red-bright:#ef4258; --muted:#d8bfc0; }
body {
  font-family: "Poppins", sans-serif;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(173,14,39,.58), transparent 42%),
    radial-gradient(ellipse at 100% 80%, rgba(86,5,20,.35), transparent 45%),
    #120305;
}
.container { max-width: 820px; }
.back { color: var(--gold); letter-spacing: .4px; }
.panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(52,7,16,.98), rgba(17,3,7,.98));
  border: 1px solid rgba(233,201,138,.34);
  border-radius: 16px;
  padding: clamp(20px,4vw,36px);
  box-shadow: 0 25px 80px rgba(0,0,0,.42), 0 0 45px rgba(168,18,42,.12);
}
.panel::before {
  content: "蛇";
  position: absolute;
  top: 8px;
  left: -25px;
  color: rgba(255,91,109,.8);
  font: 18px serif;
  text-shadow: 0 0 12px rgba(255,50,76,.75);
  animation: calculatorSerpent 13s linear infinite;
  pointer-events: none;
}
@keyframes calculatorSerpent {
  0% { left:-25px; opacity:0; transform:rotate(0); }
  8%,90% { opacity:.9; }
  50% { transform:rotate(9deg); }
  100% { left:calc(100% + 10px); opacity:0; transform:rotate(0); }
}
h1 { font-family:"Cinzel",serif; color:#fff0d9; font-size:clamp(25px,4vw,38px); letter-spacing:1.2px; text-shadow:0 0 28px rgba(239,66,88,.22); }
.subtitle { color:var(--muted); }
label { color:#f0d8d5; }
select,input {
  font-family:"Poppins",sans-serif;
  background:#170307;
  border-color:rgba(233,201,138,.28);
  border-radius:8px;
}
select:focus,input:focus { border-color:#ff6674; box-shadow:0 0 0 3px rgba(239,66,88,.15); }
.tax-info {
  background:linear-gradient(135deg,rgba(119,10,31,.6),rgba(37,5,13,.9));
  border-color:rgba(233,201,138,.36);
}
.tax-info strong { color:var(--gold); }
.resource-card {
  background:linear-gradient(145deg,rgba(67,9,22,.82),rgba(25,4,10,.95));
  border-color:rgba(233,201,138,.2);
  border-radius:11px;
}
.resource-card:hover { border-color:rgba(255,102,116,.7); box-shadow:0 10px 30px rgba(168,18,42,.15); }
.resource-card label { color:var(--gold); }
button { font-family:"Poppins",sans-serif; }
.quick-buttons button, .calculate-button {
  background:linear-gradient(135deg,#f0d6a0,#b77b45);
  color:#21040a;
}
.clear-button {
  background:linear-gradient(135deg,#a8122a,#570817);
  border-color:rgba(255,102,116,.55);
}
.result {
  background:linear-gradient(145deg,#260810,#140409);
  border-color:rgba(233,201,138,.38);
}
.result h2 { color:var(--gold); font-family:"Cinzel",serif; }
.result h3 { color:#ff9298; }
.total-card {
  background:linear-gradient(145deg,#4b0b1a,#21050d);
  border-color:rgba(233,201,138,.34);
}
.total-card strong { color:#f4dca8; }
.net { color:#91e0b1; }
.tax { color:#ff9298; }
.gross-bar { background:linear-gradient(90deg,#a8122a,#e9c98a); }
.tax-bar { background:linear-gradient(90deg,#8d1024,#ff7180); }
.net-bar { background:linear-gradient(90deg,#348c60,#83df9d); }
.graph-title { color:var(--gold); }
.note, .detail-row span { color:var(--muted); }
footer { color:#bd999c; }
@media (prefers-reduced-motion: reduce) { .panel::before { animation:none; } }

/* MYSTIC DRAGON REALM V2 — RESOURCE CALCULATOR FINISHING PASS */
:root{--gold:var(--gilt);--red:var(--crimson);--muted:#b4a5a6;--border:var(--line-2)}
body{font-family:var(--body);background:radial-gradient(ellipse at 50% 0,rgba(209,40,59,.2),transparent 48%),var(--ink);color:var(--text)}
.container{max-width:820px}
.panel{background:linear-gradient(145deg,rgba(36,24,32,.98),rgba(16,11,13,.98));border-color:var(--line-2);box-shadow:var(--shadow-deep)}
h1,.result h2{font-family:var(--display);color:#f6eee9}
.subtitle,.note,.detail-row span{color:var(--muted)}
label,.resource-card label{color:var(--gilt)}
select,input{font-family:var(--body);background:#100b0d;border-color:var(--line-2);color:var(--text)}
select:focus,input:focus{border-color:var(--gilt);box-shadow:0 0 0 3px rgba(232,194,122,.15)}
.tax-info,.resource-card,.result,.detail-card{border-color:var(--line);background:linear-gradient(145deg,rgba(36,24,32,.95),rgba(16,11,13,.98))}
.resource-card:hover{border-color:var(--gilt);box-shadow:var(--shadow-gold)}
.quick-buttons button,.calculate-button{background:linear-gradient(135deg,#f3d590,#b88942);color:#1b1208}
.clear-button{background:linear-gradient(135deg,var(--crimson),var(--crimson-deep));border-color:var(--crimson)}
.total-card{background:linear-gradient(145deg,#4b0b1a,#21050d);border-color:var(--line-2)}
.net{color:var(--jade)}.tax{color:var(--warn)}
.gross-bar{background:linear-gradient(90deg,var(--crimson-deep),var(--gilt))}
.tax-bar{background:linear-gradient(90deg,#8d1024,var(--warn))}
.net-bar{background:linear-gradient(90deg,#348c60,var(--jade))}
footer{color:var(--faint)}


/* SHARED RESOURCE QUICK ADD */
.quick-add-panel{margin-top:16px;padding:16px;border:1px solid var(--line-2);border-radius:12px;background:linear-gradient(145deg,rgba(36,24,32,.95),rgba(16,11,13,.98))}
.quick-add-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;color:var(--gilt);font-size:13px}
.quick-add-heading span{color:var(--muted);font-size:12px}
.quick-add-heading b{color:var(--gilt)}
.quick-add-panel p{margin:9px 0 0;color:var(--muted);font-size:12px;line-height:1.6}
.quick-add-panel .quick-buttons{margin-top:12px}
.quick-add-panel .quick-buttons button{font-size:12px;padding:12px 6px}
.resource-card.is-active{border-color:var(--gilt);box-shadow:0 0 0 2px rgba(232,194,122,.16),var(--shadow-gold)}
.resource-card{cursor:pointer}
@media(max-width:400px){.quick-add-panel{padding:12px}.quick-add-panel .quick-buttons button{font-size:10px;padding:11px 3px}}


/* STACK RESOURCE INPUTS VERTICALLY */
.resource-grid{grid-template-columns:minmax(0,1fr)}
.resource-card{width:100%}
