@font-face {
  font-family: 'NMSGeo';
  src: url('NMSGeoSans_Kerned.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #03080b;
  --panel: rgba(8, 18, 24, 0.92);
  --input-bg: rgba(4, 10, 14, 0.95);
  --row-hover: rgba(0, 200, 200, 0.04);
  --teal: #4dcfcf;
  --teal-dim: #1e6060;
  --teal-glow: rgba(77, 207, 207, 0.2);
  --gold: #d4a017;
  --white: #e0f0f0;
  --dim: #6a9090;
  --red: #cc3333;
  --orange: #d47820;
  --border: rgba(77, 207, 207, 0.15);
  --border2: rgba(77, 207, 207, 0.07);
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: 'NMSGeo', sans-serif;
  background: var(--bg);
  color: var(--white);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 55% at 72% 38%, rgba(0, 70, 70, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 45% 65% at 18% 72%, rgba(0, 30, 55, 0.4) 0%, transparent 60%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle 2px at 14% 33%, rgba(77, 207, 207, 0.22) 0%, transparent 100%),
    radial-gradient(circle 3px at 82% 18%, rgba(77, 207, 207, 0.14) 0%, transparent 100%),
    radial-gradient(circle 2px at 60% 73%, rgba(212, 160, 23, 0.18) 0%, transparent 100%),
    radial-gradient(circle 4px at 38% 88%, rgba(77, 207, 207, 0.1) 0%, transparent 100%);
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  z-index: 500;
  background: rgba(3, 8, 11, 0.97);
  border-bottom: 1px solid var(--teal-dim);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--teal) 50%, transparent 90%);
  opacity: 0.35;
}

.header-inner {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(77, 207, 207, 0.4));
  transition: transform 0.3s, filter 0.3s;
}

.brand-logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 20px rgba(77, 207, 207, 0.7));
}

.brand-title {
  font-family: 'NMSGeo', sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--white);
  text-shadow: 0 0 18px rgba(77, 207, 207, 0.3);
}

.brand-sub {
  font-family: 'NMSGeo', sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--teal-dim);
  margin-top: 2px;
}

.app-main {
  position: fixed;
  top: 54px;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 420px 1fr;
  overflow: hidden;
  z-index: 1;
}

.editor-area {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--border2);
  background: var(--panel);
  backdrop-filter: blur(8px);
}

.editor-tabs {
  display: flex;
  flex-shrink: 0;
  background: rgba(3, 8, 11, 0.8);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border2);
  color: var(--dim);
  cursor: pointer;
  font-family: 'NMSGeo', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.tab-btn:last-child {
  border-right: none;
}

.tab-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.1));
  transition: filter 0.15s;
}

.tab-btn:hover .tab-icon {
  filter: brightness(1.2) drop-shadow(0 0 8px rgba(77, 207, 207, 0.3));
}

.tab-btn.active .tab-icon {
  filter: brightness(1.3) drop-shadow(0 0 10px rgba(77, 207, 207, 0.5));
}

.tab-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
}

.tab-btn:hover {
  background: rgba(77, 207, 207, 0.04);
  color: var(--white);
}

.tab-btn.active {
  color: var(--teal);
  background: rgba(0, 50, 55, 0.25);
}

.tab-btn.active::after {
  background: var(--teal);
  box-shadow: 0 0 10px rgba(77, 207, 207, 0.6);
}

.editor-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

.editor-content::-webkit-scrollbar {
  width: 3px;
}

.editor-content::-webkit-scrollbar-track {
  background: transparent;
}

.editor-content::-webkit-scrollbar-thumb {
  background: var(--teal-dim);
}

.tab-panel {
  display: none;
  padding: 18px;
}

.tab-panel.active {
  display: block;
}

.tab-hint {
  font-size: 11px;
  color: var(--dim);
  line-height: 1.6;
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.form-row .form-group {
  margin-bottom: 0;
}

label {
  font-family: 'NMSGeo', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
}

input[type="text"],
input[type="number"],
select,
textarea {
  background: var(--input-bg);
  border: none;
  border-bottom: 1px solid var(--teal-dim);
  color: var(--white);
  font-family: 'NMSGeo', sans-serif;
  font-size: 13px;
  padding: 8px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, background 0.2s;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-bottom-color: var(--teal);
  background: rgba(0, 30, 35, 0.7);
}

select option {
  background: #040d10;
  color: var(--white);
}

textarea {
  resize: none;
}

.char-counter {
  font-family: 'NMSGeo', sans-serif;
  font-size: 9px;
  color: var(--teal-dim);
  text-align: right;
  margin-top: 2px;
}

.font-section {
  margin-top: 20px;
  border-top: 1px solid var(--border2);
  padding-top: 16px;
}

.font-section-title {
  font-family: 'NMSGeo', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal-dim);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.font-section-title span {
  font-size: 16px;
  color: var(--teal);
  opacity: 0.7;
}

.font-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.font-upload-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  font-family: 'NMSGeo', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.font-upload-btn::before,
.font-upload-btn::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
}

.font-upload-btn::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--teal);
  border-left: 1px solid var(--teal);
}

.font-upload-btn::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 1px solid var(--teal);
  border-right: 1px solid var(--teal);
}

.font-upload-btn:hover {
  background: rgba(77, 207, 207, 0.07);
  border-color: var(--teal);
  color: #6ff;
}

.font-name-display {
  font-family: 'NMSGeo', sans-serif;
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.font-scope-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.font-scope-label {
  font-family: 'NMSGeo', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dim);
  flex-shrink: 0;
}

.font-scope-btns {
  display: flex;
  gap: 4px;
}

.scope-btn {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--dim);
  font-family: 'NMSGeo', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.scope-btn.active {
  background: rgba(77, 207, 207, 0.1);
  border-color: var(--teal);
  color: var(--teal);
}

.scope-btn:hover:not(.active) {
  background: rgba(77, 207, 207, 0.04);
  color: var(--white);
}

.font-clear-btn {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(200, 50, 50, 0.35);
  color: rgba(180, 60, 60, 0.7);
  padding: 5px 0;
  font-family: 'NMSGeo', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.font-clear-btn:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}

.glyph-section {
  margin-top: 20px;
  border-top: 1px solid var(--border2);
  padding-top: 16px;
}

.glyph-section-title {
  font-family: 'NMSGeo', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal-dim);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.glyph-section-title span {
  font-size: 16px;
  color: var(--teal);
  opacity: 0.7;
}

.glyph-input-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--input-bg);
  border-bottom: 1px solid var(--teal-dim);
  padding: 8px;
  margin-bottom: 12px;
  min-height: 48px;
}

.glyph-sequence {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.glyph-sequence img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.4));
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--dim);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}

.btn-icon:hover:not(:disabled) {
  background: rgba(77, 207, 207, 0.1);
  color: var(--teal);
  border-color: var(--teal);
}

.btn-icon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.glyph-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.glyph-btn {
  background: rgba(3, 8, 11, 0.6);
  border: 1px solid var(--border);
  padding: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glyph-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2));
  transition: filter 0.15s;
}

.glyph-btn:hover {
  background: rgba(77, 207, 207, 0.1);
  border-color: var(--teal);
}

.glyph-btn:hover img {
  filter: drop-shadow(0 0 6px rgba(77, 207, 207, 0.6)) brightness(1.2);
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border2);
}

.type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 4px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border2);
  color: var(--dim);
  cursor: pointer;
  font-family: 'NMSGeo', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.type-btn:last-child,
.type-btn:nth-child(4) {
  border-right: none;
}

.type-btn:nth-child(n+5) {
  border-top: 1px solid var(--border2);
}

.type-btn:hover {
  background: rgba(77, 207, 207, 0.04);
  color: var(--white);
}

.type-emoji {
  font-size: 20px;
  line-height: 1;
}

.type-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.type-badge-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.attack-type-img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}

.class-icon-btn {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  transition: filter 0.15s;
}

.class-icon-card {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.type-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s;
}

.type-btn.active {
  color: #fff;
}

.type-btn[data-type="fire"].active {
  background: rgba(200, 60, 0, 0.1);
}

.type-btn[data-type="fire"].active::after {
  background: #FF4400;
  box-shadow: 0 0 8px rgba(255, 68, 0, 0.7);
}

.type-btn[data-type="tropical"].active {
  background: rgba(64, 160, 0, 0.1);
}

.type-btn[data-type="tropical"].active::after {
  background: #5DC000;
  box-shadow: 0 0 8px rgba(93, 192, 0, 0.7);
}

.type-btn[data-type="anomalous"].active {
  background: rgba(136, 48, 192, 0.1);
}

.type-btn[data-type="anomalous"].active::after {
  background: #9B30D0;
  box-shadow: 0 0 8px rgba(155, 48, 208, 0.7);
}

.type-btn[data-type="toxic"].active {
  background: rgba(192, 160, 0, 0.1);
}

.type-btn[data-type="toxic"].active::after {
  background: #80BB00;
  box-shadow: 0 0 8px rgba(128, 187, 0, 0.7);

}

.type-btn[data-type="radioactive"].active {
  background: rgba(112, 170, 0, 0.1);
}

.type-btn[data-type="radioactive"].active::after {
  background: #D4B000;
  box-shadow: 0 0 8px rgba(212, 176, 0, 0.7);
}

.type-btn[data-type="desert"].active {
  background: rgba(144, 96, 48, 0.1);
}

.type-btn[data-type="desert"].active::after {
  background: #9C6320;
  box-shadow: 0 0 8px rgba(156, 99, 32, 0.7);
}

.type-btn[data-type="ice"].active {
  background: rgba(32, 144, 176, 0.1);
}

.type-btn[data-type="ice"].active::after {
  background: #30B0CC;
  box-shadow: 0 0 8px rgba(48, 176, 204, 0.7);
}

.type-btn[data-type="mechanical"].active {
  background: rgba(24, 72, 160, 0.1);
}

.type-btn[data-type="mechanical"].active::after {
  background: #1A4AAF;
  box-shadow: 0 0 8px rgba(26, 74, 175, 0.7);
}

.image-drop-zone {
  border: 1px dashed var(--teal-dim);
  background: var(--input-bg);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  position: relative;
}

.image-drop-zone:hover {
  border-color: var(--teal);
  background: rgba(0, 30, 35, 0.6);
}

.image-drop-zone.drag-over {
  border-color: var(--teal);
  background: rgba(77, 207, 207, 0.06);
}

.drop-placeholder {
  text-align: center;
  color: var(--teal-dim);
  padding: 24px;
  font-family: 'NMSGeo', sans-serif;
}

.drop-icon {
  font-size: 32px;
  margin-bottom: 10px;
  opacity: 0.4;
}

.drop-placeholder p {
  font-size: 12px;
  line-height: 1.8;
  font-weight: 400;
}

.drop-placeholder span {
  font-size: 10px;
  opacity: 0.5;
  letter-spacing: 1px;
}

.drop-img-preview {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.btn-secondary {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(200, 50, 50, 0.35);
  color: rgba(190, 70, 70, 0.7);
  padding: 6px 0;
  font-family: 'NMSGeo', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
}

.btn-secondary:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}

.attack-editor-row {
  border-bottom: 1px solid var(--border2);
  padding: 12px 0;
}

.attack-editor-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.attack-row-header {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.attack-row-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--teal-dim), transparent);
  opacity: 0.5;
}

.attack-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attack-type-name-dmg {
  display: grid;
  grid-template-columns: 85px 1fr 65px;
  gap: 10px;
}

.attr-editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border2);
}

.attr-editor-row:last-child {
  border-bottom: none;
}

.attr-ed-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--white);
  flex: 1;
  text-transform: uppercase;
}

.rating-btns {
  display: flex;
  gap: 5px;
}

.rating-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 2px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rating-btn:hover .class-icon-btn {
  filter: brightness(1.4) drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

.rating-btn.active {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.rating-btn.active[data-rating="C"] {
  box-shadow: 0 0 8px rgba(75, 184, 88, 0.4);
}

.rating-btn.active[data-rating="B"] {
  box-shadow: 0 0 10px rgba(51, 102, 221, 0.5);
}

.rating-btn.active[data-rating="A"] {
  box-shadow: 0 0 10px rgba(200, 48, 200, 0.6);
}

.rating-btn.active[data-rating="S"] {
  box-shadow: 0 0 14px rgba(200, 144, 0, 0.5);
}

.preview-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: hidden;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.preview-sticky {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.preview-label {
  font-family: 'NMSGeo', sans-serif;
  font-size: 9px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--teal-dim);
}

.card-wrapper {
  position: relative;
  transition: filter 0.4s;
}

.card-wrapper::before,
.card-wrapper::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  z-index: 10;
  pointer-events: none;
}

.card-wrapper::before {
  top: -6px;
  left: -6px;
  border-top: 1px solid var(--teal);
  border-left: 1px solid var(--teal);
}

.card-wrapper::after {
  bottom: -6px;
  right: -6px;
  border-bottom: 1px solid var(--teal);
  border-right: 1px solid var(--teal);
}

.card {
  width: 380px;
  height: 532px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px;
  font-family: 'NMSGeo', sans-serif;
  cursor: default;
  transition: transform 0.3s ease, box-shadow 0.4s;
}

.card:hover {
  transform: perspective(900px) rotateY(3deg) rotateX(-2deg);
}

.card:hover .card-shine {
  opacity: 1;
}

.card[data-type="fire"] {
  --cp: #CC2200;
  --cbg1: #FFE4CC;
  --cbg2: #FFB060;
  --cborder: #FF4400;
  --cglow: rgba(255, 100, 0, .55);
  --ctext: #5C1000;
  --chr: #CC2200;
  --cbadge: #FF4400;
  --cfoot: rgba(204, 34, 0, .12);
  --ctag: #CC2200;
}

.card[data-type="tropical"] {
  --cp: #3D8A00;
  --cbg1: #EAFFD0;
  --cbg2: #A8E050;
  --cborder: #5DC000;
  --cglow: rgba(93, 192, 0, .55);
  --ctext: #1A4A00;
  --chr: #4A9800;
  --cbadge: #4A9800;
  --cfoot: rgba(61, 138, 0, .12);
  --ctag: #3D8A00;
}

.card[data-type="anomalous"] {
  --cp: #7B2FBE;
  --cbg1: #F2DCFF;
  --cbg2: #C070FF;
  --cborder: #9B30D0;
  --cglow: rgba(155, 48, 208, .55);
  --ctext: #3A0080;
  --chr: #7B2FBE;
  --cbadge: #8820C0;
  --cfoot: rgba(123, 47, 190, .12);
  --ctag: #7B2FBE;
}

.card[data-type="toxic"] {
  --cp: #5A8800;
  --cbg1: #F0FFE0;
  --cbg2: #C4E860;
  --cborder: #80BB00;
  --cglow: rgba(128, 187, 0, .55);
  --ctext: #2A4400;
  --chr: #5A8800;
  --cbadge: #628800;
  --cfoot: rgba(90, 136, 0, .12);
  --ctag: #5A8800;
}

.card[data-type="radioactive"] {

  --cp: #B8A000;
  --cbg1: #FFFDE8;
  --cbg2: #FFE840;
  --cborder: #D4B000;
  --cglow: rgba(212, 176, 0, .55);
  --ctext: #5A4800;
  --chr: #B8A000;
  --cbadge: #C0A000;
  --cfoot: rgba(184, 160, 0, .12);
  --ctag: #B8A000;
}

.card[data-type="desert"] {
  --cp: #7A4818;
  --cbg1: #FAF0E0;
  --cbg2: #D4A868;
  --cborder: #9C6320;
  --cglow: rgba(156, 99, 32, .55);
  --ctext: #3C2000;
  --chr: #8A5820;
  --cbadge: #8A5820;
  --cfoot: rgba(122, 72, 24, .12);
  --ctag: #7A4818;
}

.card[data-type="ice"] {
  --cp: #1890B0;
  --cbg1: #E4FEFF;
  --cbg2: #88D8F0;
  --cborder: #30B0CC;
  --cglow: rgba(48, 176, 204, .55);
  --ctext: #003858;
  --chr: #1890B0;
  --cbadge: #1890B0;
  --cfoot: rgba(24, 144, 176, .12);
  --ctag: #1890B0;
}

.card[data-type="mechanical"] {
  --cp: #0A2878;
  --cbg1: #DCE8FF;
  --cbg2: #6890E0;
  --cborder: #1A4AAF;
  --cglow: rgba(26, 74, 175, .55);
  --ctext: #000830;
  --chr: #0A2878;
  --cbadge: #1040A0;
  --cfoot: rgba(10, 40, 120, .12);
  --ctag: #0A2878;
}

.card {
  background: linear-gradient(155deg, var(--cbg1) 0%, var(--cbg2) 100%);
  border: 8px solid var(--cborder);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.4),
    0 0 0 2px rgba(255, 215, 80, 0.4),
    0 0 30px var(--cglow),
    0 24px 64px rgba(0, 0, 0, 0.75);
}

.card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  z-index: 10;
}

.card-full-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  border-radius: 10px;
}

.card-full-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, .15) 30%, rgba(0, 0, 0, .65) 65%, rgba(0, 0, 0, 1) 100%);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
  border-radius: 10px;
}

.card.is-full-art .card-full-overlay {
  opacity: 1;
}

.card.is-full-art .card-illus-frame {
  opacity: 0;
  pointer-events: none;
}

.card.is-full-art .card-hr {
  opacity: .35;
}

.card.is-full-art .attr-label {
  color: rgba(255, 255, 255, .9);
}

.card.is-full-art .card-flavor {
  color: rgba(255, 255, 255, .95);
}

.card.is-full-art .hp-label,
.card.is-full-art .card-stage,
.card.is-full-art .footer-num,
.card.is-full-art .footer-brand {
  color: rgba(255, 255, 255, .8);
}

.card.is-full-art .card-name,
.card.is-full-art .hp-value {
  color: #fff;
}

.card.is-full-art .attack-name {
  color: #fff;
}

.card.is-full-art .attack-dmg {
  color: #fff;
}

.card.is-full-art .attack-desc {
  color: rgba(255, 255, 255, .85);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0, rgba(255, 255, 255, .04) 1px, transparent 1px, transparent 8px);
  pointer-events: none;
  z-index: 0;
}

.card>*:not(.card-full-bg):not(.card-full-overlay):not(.card-shine) {
  position: relative;
  z-index: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.card-stage {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--ctext);
  opacity: .65;
  text-transform: uppercase;
}

.card-name {
  font-family: 'NMSGeo', sans-serif;
  font-size: 15px;
  font-weight: 900;
  color: var(--ctext);
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(255, 255, 255, .5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 195px;
}

.card-hp-block {
  display: flex;
  align-items: center;
  gap: 3px;
}

.hp-label {
  font-family: 'NMSGeo', sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: var(--ctext);
  opacity: .65;
}

.hp-value {
  font-family: 'NMSGeo', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: var(--ctext);
  line-height: 1;
}

.card-type-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cbadge);
  border: 2px solid rgba(255, 255, 255, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  margin-left: 4px;
}

.card-illus-frame {
  border: 3px solid var(--ctext);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 2px 8px rgba(0, 0, 0, .3);
}

.card-illus-inner {
  width: 100%;
  height: 148px;
  background: linear-gradient(135deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .25));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-illus-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.illus-empty {
  text-align: center;
  color: var(--ctext);
  opacity: .4;
  font-size: 11px;
}

.illus-empty span {
  font-size: 28px;
  display: block;
  margin-bottom: 4px;
}

.illus-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ctag);
  padding: 2px 8px;
}

.illus-type-tag {
  font-family: 'NMSGeo', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, .9);
}

.illus-rarity-tag {
  font-family: 'NMSGeo', sans-serif;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 3px;
  line-height: 1.4;
}

.card-flavor {
  font-size: 9px;
  font-style: italic;
  color: var(--ctext);
  opacity: .75;
  text-align: center;
  padding: 5px 2px;
  line-height: 1.4;
}

.card-hr {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--chr), transparent);
  margin: 3px 0;
  opacity: .6;
}

.card-attacks {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.attack-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 6px;
  align-items: center;
}

.attack-icon {
  grid-row: 1/3;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cbadge);
  border: 1.5px solid rgba(255, 255, 255, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  align-self: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  flex-shrink: 0;
}

.attack-name {
  font-family: 'NMSGeo', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--ctext);
  letter-spacing: .3px;
  align-self: end;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attack-dmg {
  font-family: 'NMSGeo', sans-serif;
  font-size: 14px;
  font-weight: 900;
  color: var(--ctext);
  align-self: end;
  line-height: 1;
}

.attack-desc {
  grid-column: 2/4;
  font-size: 8.5px;
  font-style: italic;
  color: var(--ctext);
  opacity: .7;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-attrs {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 4px;
}

.card-attr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.attr-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--ctext);
  opacity: .8;
  text-transform: uppercase;
}

.attr-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.rating-c {
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  color: #ccc;
  border: 1px solid #666;
}

.rating-b {
  background: linear-gradient(135deg, #0d2a60, #071840);
  color: #88aaff;
  border: 1px solid #3366dd;
}

.rating-a {
  background: linear-gradient(135deg, #3a2200, #251600);
  color: #ffd060;
  border: 1px solid #c89000;
}

.rating-s {
  background: linear-gradient(135deg, #2a0030, #180028, #0d1030);
  color: #ff88ff;
  border: 1px solid #cc30cc;
  text-shadow: 0 0 8px rgba(255, 100, 255, .7);
}

.card-glyphs {
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-glyphs img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: brightness(1.2) drop-shadow(0 0 2px rgba(255, 255, 255, 0.4));
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--cfoot);
  border-radius: 3px;
  padding: 3px 6px;
  margin-top: auto;
}

.footer-num,
.footer-brand {
  font-family: 'NMSGeo', sans-serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--ctext);
  opacity: .55;
  text-transform: uppercase;
}

.btn-download {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 28px;
  background: rgba(3, 8, 11, 0.85);
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  font-family: 'NMSGeo', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  backdrop-filter: blur(4px);
}

.btn-download::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--teal);
  border-left: 1px solid var(--teal);
}

.btn-download::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-bottom: 1px solid var(--teal);
  border-right: 1px solid var(--teal);
}

.btn-download:hover {
  background: rgba(0, 40, 45, .9);
  border-color: var(--teal);
  color: #5fffff;
  box-shadow: 0 0 20px rgba(77, 207, 207, .2);
}

.btn-download:active {
  transform: scale(.98);
}

.btn-download.loading {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

.card.exporting .card-shine,
.card.exporting::before {
  display: none !important;
}

.card.exporting,
.card.exporting * {
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
  html, body {
    overflow-y: auto;
    height: auto;
  }

  .app-header {
    position: sticky;
    top: 0;
  }

  .header-inner {
    padding: 0 15px;
  }

  .brand-title {
    font-size: 16px;
    letter-spacing: 3px;
  }

  .app-main {
    position: static;
    display: flex;
    flex-direction: column-reverse;
    height: auto;
    overflow: visible;
  }

  .editor-area {
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 1px solid var(--teal-dim);
    overflow: visible;
    flex-shrink: 0;
  }

  .editor-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    display: flex;
    scrollbar-width: none;
    position: sticky;
    top: 54px;
    z-index: 100;
    background: rgba(8, 18, 24, 0.98);
  }

  .editor-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    min-width: 90px;
    flex: none;
    padding: 12px 5px;
  }

  .editor-content {
    overflow: visible;
    height: auto;
  }

  .preview-panel {
    width: 100%;
    min-height: auto;
    padding: 50px 0 30px 0;
    overflow: visible;
    background: radial-gradient(circle at center, rgba(77, 207, 207, 0.05) 0%, transparent 70%);
  }

  .preview-sticky {
    position: static;
  }

  .card-wrapper {
    transform: scale(0.9);
    margin: 0 auto;
    transform-origin: center top;
  }

  /* Form adjustments */
  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .attack-type-name-dmg {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .type-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .glyph-picker {
    grid-template-columns: repeat(4, 1fr);
  }

  .rating-btns {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .card-wrapper {
    transform: scale(0.8);
  }
  
  .brand-text {
    display: flex;
    flex-direction: column;
  }
  
  .brand-sub {
    font-size: 8px;
    letter-spacing: 1px;
  }
  
  .preview-panel {
    padding: 20px 0 60px 0;
  }
}