


:root{
  --blue-top: #8fd3f4;
  --blue-main: #5db9e8;
  --blue-bottom: #3a8fc4;

  --card: rgba(255,255,255,0.92);
  --card-border: rgba(15, 23, 42, 0.10);
  --shadow: 0 14px 40px rgba(2, 6, 23, 0.18);

  --text: #0f172a;
  --text-sub: rgba(15, 23, 42, 0.72);

  --field: rgba(246, 249, 252, 1);
  --field-border: rgba(2, 6, 23, 0.12);

  --yellow: #ffd84d;
  --yellow-deep: #f2b705;
  --yellow-text: #5a4500;

  --r-card: 18px;
  --r-control: 14px;
  --r-chip: 12px;
}


body{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 20px 20px 92px;
  background:
    linear-gradient(145deg, rgba(255, 216, 77, 0.08) 0%, rgba(255, 216, 77, 0.025) 18%, transparent 34%),
    linear-gradient(215deg, rgba(72, 169, 255, 0.12) 0%, rgba(72, 169, 255, 0.035) 28%, transparent 48%),
    linear-gradient(180deg, #03052c 0%, #06275f 56%, #1f66c1 100%);
  background-attachment: fixed;
  color: var(--text);
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(118deg, transparent 0%, transparent 42%, rgba(255,255,255,0.038) 42.2%, transparent 43.2%, transparent 100%),
    linear-gradient(142deg, transparent 0%, transparent 58%, rgba(255,216,77,0.040) 58.2%, transparent 59.2%, transparent 100%),
    repeating-linear-gradient(116deg, transparent 0 54px, rgba(255,255,255,0.018) 55px, transparent 57px);
  background-size: 100% 100%, 100% 100%, 180px 180px;
  opacity: 0.48;
}

body > *{ position: relative; z-index: 1; }

h1{ margin: 0 0 10px; }


.container{ max-width: 760px; margin: 0 auto; }

body.is-total-all-mode .container > .card:not(#totalCard):not(#dataToolsCard){
  display: none;
}

body.is-total-all-mode .app-version{
  display: none;
}

body.is-total-all-mode #totalCard{
  margin-top: 0;
}

.card{
  background: rgba(255,255,255,0.96);  
  border: 1px solid rgba(255,255,255,0.08);

  border-radius: var(--r-card);
  padding: 16px;

  box-shadow:
    0 20px 40px rgba(0,0,0,0.35);

  backdrop-filter: none;              
  -webkit-backdrop-filter: none;

  margin-bottom: 16px;
}



.logo{
  display:flex;
  justify-content:center;
  margin: 10px 0 18px;
}
.logo-svg{ display:inline-flex; }
.logo-mark{
  width: min(520px, 86vw);
  height:auto;
  display:block;
}


.app-logo{
  width: min(520px, 90vw);
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 10px 28px rgba(2, 6, 23, 0.25));
}


label{
  background: transparent;
  border: 0;
}


input, select{
  width: 100%;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--field-border);
  border-radius: var(--r-chip);
  padding: 10px;
  font-size: 16px;
  box-sizing: border-box;
}

input:focus, select:focus{
  outline: none;
  border-color: rgba(242, 183, 5, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 216, 77, 0.35);
}

input[type="search"]::-webkit-search-cancel-button{
  -webkit-appearance: none;
  appearance: none;
}

.clearable-input{
  position: relative;
  display: block;
  width: 100%;
}

.clearable-input input{
  padding-right: 40px;
}

.input-clear-btn{
  position: absolute;
  top: 50%;
  right: 8px;
  width: 28px !important;
  min-width: 28px;
  max-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0 !important;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.95);
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
  font-size: 1.15rem;
  line-height: 1;
  text-shadow: none;
  touch-action: manipulation;
}

.clearable-input > .input-clear-btn{
  left: auto;
  right: 8px;
}

.input-clear-btn.is-hidden{
  display: none;
}

.input-clear-btn:active{
  transform: translateY(-50%) scale(0.94);
}


button{
  padding: 16px;
  border-radius: var(--r-control);
  border: 1px solid rgba(2, 6, 23, 0.10);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.12);
  transition: transform 0.08s ease, filter 0.12s ease, box-shadow 0.12s ease;
  background: rgba(255,255,255,0.90); 
  color: var(--text);
}


button:active,
.chip:active{
  transform: translateY(2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}


#calcBtn{
  width: 100%;
  margin-top: 12px;

  background: linear-gradient(
    180deg,
    #d8aa45 0%,
    #9b6a1e 52%,
    #704416 100%
  );

  color: #ffffff;
  border: 1px solid rgba(134, 91, 28, 0.46);

  box-shadow:
    0 4px 0 rgba(112, 68, 22, 0.62),
    0 14px 26px rgba(86, 54, 18, 0.24);

  text-shadow: 0 1px 2px rgba(45, 28, 8, 0.34);
}


#resetBtn{
  width: 100%;
  margin-top: 24px;
  background: rgba(255,255,255,0.86);
  color: rgba(15, 23, 42, 0.75);
  font-size: 14px;
  font-weight: 700;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.10);
}
#resetBtn:active{ opacity: 0.78; }


#result, #total{
  margin-top: 16px;
  font-size: 18px;
}
#result{ white-space: pre-line; line-height: 1.5; }


#result.tier-bad{ color: #dc2626; }

#result.tier-blue{
  color: #2563eb;
  text-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
#result.tier-green{
  color: #16a34a;
  text-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
#result.tier-purple{
  color: #7c3aed;
  text-shadow: 0 1px 6px rgba(0,0,0,0.12);
}


progress{
  width: 100%;
  height: 18px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
}
progress::-webkit-progress-bar{
  background: rgba(255,255,255,0.65);
  border-radius: 999px;
}
progress::-webkit-progress-value{
  background: linear-gradient(90deg, #ffe680, var(--yellow), #f7c800);
  border-radius: 999px;
}


.machine-info{ 
 
  background: rgba(216, 216, 216, 0.55);   
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 12px;
  padding: 10px 12px;

}

.info-lines p{
  margin: 8px 0;
  color: var(--text-sub);
}


.machine-row{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.machine-label{
  width: 100%;
  order: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 10px;
  align-items: end;
  position: relative;
}

.machine-label select{
  grid-column: 1 / -1;
}

.machine-label #favoriteBtn{
  position: absolute;
  right: 0;
  top: -2px;
  z-index: 2;
}

.machine-label #infoBorder{
  grid-column: 1;
  justify-self: end;
  align-self: end;
}

.store-row{ order: 1; }
.rate-row{ order: 4; }

.equivalent-border{
  font-size: 1.05rem;
  color: rgba(15, 23, 42, 0.85);
  font-weight: 600;
  min-height: 1.4em;
  margin: 6px 0 0;
  padding-left: 0;
  line-height: 1.2;
  white-space: nowrap;
  text-align: right;

  
  transition: opacity 0.25s ease;
}

.equivalent-border.is-updating{
  opacity: 0;
}

.equivalent-border.is-revealing{
  animation: borderReveal 0.55s ease-out forwards;
}


.equivalent-border.is-updating{opacity: 0;}



.rate-row{
  display: flex;        
  gap: 30px;
  margin-top: 4px;      
  margin-left: 1em;
}
.rate-row p{ 
  font-size: 0.85rem;   
  opacity: 0.75;        
  font-weight: 500;
  margin: 0; }

@keyframes borderReveal{
  from{
    opacity: 0;
    transform: translateY(-8px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}


@media (prefers-reduced-motion: reduce){
  .equivalent-border.is-revealing{ animation: none; }
}


.invest-buttons{
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 16px;
}

#investCard.is-output-source .invest-buttons{
  display: none;
}

.output-use-row{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(144px, 0.86fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.output-use-row label{
  margin: 0;
}

#outputUseBtn{
  min-height: 58px;
  padding: 10px 12px;
  border-radius: var(--r-control);
  font-size: 0.88rem;
  line-height: 1.25;
  font-weight: 800;
}
.invest-row{ display: flex; gap: 10px; }

.chip{
  flex: 1;
  padding: 14px 0;
  border-radius: var(--r-chip);
  border: 1px solid rgba(29, 78, 216, 0.34);

  background: linear-gradient(
    180deg,
    #3587e6 0%,
    #1556a8 100%
  );

  color: #ffffff;
  text-shadow: 0 1px 2px rgba(2, 6, 23, 0.26);
  box-shadow: 0 8px 18px rgba(15, 74, 150, 0.22);
}

.chip:hover{ filter: brightness(1.03); }

.chip.sub{
  background: linear-gradient(
    180deg,
    #d92d2d 0%,
    #9f1717 100%
  );
  border-color: rgba(153, 27, 27, 0.38);
  box-shadow: 0 8px 18px rgba(153, 27, 27, 0.20);
  }

.chip.clear{
  background: linear-gradient(180deg, #f8fafc 0%, #dbe5ef 100%);
  color: #334155;
  border-color: rgba(71, 85, 105, 0.24);
  text-shadow: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10);
}


.invest-buttons,
.invest-buttons *{
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.machine-label{
  width: 100%;
  box-sizing: border-box;
}


.machine-label select{
  width: 100%;
  box-sizing: border-box;
}

.machine-select-native{
  display: none;
}

.machine-picker-open{
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  background: rgba(246, 249, 252, 1);
  color: var(--text);
  border: 1px solid var(--field-border);
  border-radius: var(--r-chip);
  box-shadow: none;
  text-align: left;
}

#selectedMachineName{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.machine-picker-open__hint{
  flex: none;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(38, 108, 203, 0.10);
  color: #1d4f95;
  font-size: 12px;
}

.machine-picker-overlay{
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.42);
}

.machine-picker-modal{
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 70;
  width: min(760px, 100vw);
  height: min(82vh, 720px);
  max-height: min(82vh, 720px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  padding: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -20px 42px rgba(2, 6, 23, 0.28);
}

.machine-picker-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.machine-picker-header h2{
  margin: 0;
  font-size: 1.05rem;
}

.machine-picker-close{
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.95);
  color: #334155;
  box-shadow: none;
}

.machine-search-input,
.store-search-input{
  flex: none;
}

.picker-search-wrap{
  flex: none;
}

.machine-picker-tabs{
  display: grid;
  grid-template-columns: 0.72fr 0.72fr 1fr 1.14fr 0.72fr;
  gap: 8px;
}

.machine-picker-tab{
  padding: 9px 5px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.85);
  color: #334155;
  box-shadow: none;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.machine-picker-tab.is-active{
  background: linear-gradient(180deg, #ffd84d 0%, #f2b705 100%);
  color: #4b3700;
}

.machine-picker-list{
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.machine-picker-item{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: rgba(246, 249, 252, 0.95);
  color: var(--text);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
  text-align: left;
}

.machine-picker-item.is-current{
  border-color: rgba(242, 183, 5, 0.75);
  background: rgba(255, 248, 215, 0.95);
}

.machine-picker-item.is-store-good{
  background: #dbeafe;
  border-color: rgba(29, 78, 216, 0.32);
}

.machine-picker-item.is-store-bad{
  background: #fee2e2;
  border-color: rgba(185, 28, 28, 0.32);
}

.machine-picker-item.is-current.is-store-good,
.machine-picker-item.is-current.is-store-bad{
  border-color: rgba(242, 183, 5, 0.82);
  box-shadow: inset 0 0 0 1px rgba(242, 183, 5, 0.34);
}

.machine-picker-item strong{
  font-size: 15px;
  line-height: 1.35;
}

.machine-picker-item > span{
  color: rgba(15, 23, 42, 0.62);
  font-size: 12px;
}

.machine-picker-item__meta{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.machine-picker-item__spec{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.machine-picker-item__judge{
  flex: none;
  color: #0f172a;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.machine-picker-empty{
  margin: 20px 0;
  color: rgba(15, 23, 42, 0.62);
  text-align: center;
}

.note{
  font-size: 0.75rem;
  color: rgba(15,23,42,0.6);
  margin-top: 6px;
}

.section-title{
  margin: 0 0 10px;
  font-size: 1rem;
  opacity: 0.9;
}

.chip.state{
  background: linear-gradient(
    180deg,
    #3b8be8 0%,
    #1659ad 100%
  );
  border-color: rgba(29, 78, 216, 0.34);
  box-shadow: 0 8px 18px rgba(15, 74, 150, 0.22);
}

.log-meta{
  margin: 10px 0 0;
  color: rgba(15,23,42,0.72);
  font-size: 0.9rem;
}

.log-list{
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item{
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}


.log-item small{ opacity: 0.75; }

.log-item__side{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.log-adjust-payout{
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-radius: 999px;
  background: #eef6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 8px;
}

.is-hidden{ display:none !important; }

.app-toast{
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  z-index: 90;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.26);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

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

.app-dialog-overlay{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.48);
}

.app-dialog{
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 110;
  width: min(320px, calc(100vw - 40px));
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 56px rgba(2, 6, 23, 0.32);
  text-align: center;
}

.app-dialog h2{
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.app-dialog p{
  margin: 0 0 16px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-line;
}

.app-dialog > button{
  width: 100%;
}

.app-dialog-form{
  display: grid;
  gap: 12px;
  text-align: left;
}

.app-dialog-form label{
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
}

.app-dialog-form input{
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  font-size: 1rem;
  background: var(--field);
  color: var(--text);
  border-color: var(--field-border);
  box-shadow: none;
}

.app-dialog-form input:invalid{
  background: var(--field);
  color: var(--text);
  border-color: var(--field-border);
  box-shadow: none;
}

.app-dialog-actions{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.app-dialog-actions button{
  width: 100%;
}


.log-actions{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}


.log-actions-main,
.log-actions-after{
  display: contents; 
}


.log-actions button{
  width: 100%;
}

.log-actions-after button{
  white-space: pre-line;
  line-height: 1.15;
}

.is-disabled{
  opacity: 0.55;
  filter: grayscale(0.2);
}

#payoutPanel,
#fixedPayoutPanel{margin-top: 10px;}
#endBallsPanel{margin-top: 10px;}


input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"]{
  -moz-appearance: textfield; 
  appearance: textfield;
}


#payoutPanel,
#fixedPayoutPanel,
#endBallsPanel{
  grid-column: 1 / -1;   
  width: 100%;
}

#fixedPayoutPanel{
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 0.48fr);
  gap: 10px;
  align-items: end;
}

#fixedPayoutPanel label{
  display: grid;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}

#fixedPayoutPanel input{
  min-width: 0;
}

#btnFixedPayoutConfirm{
  min-height: 48px;
  padding: 8px 12px;
  line-height: 1.15;
  white-space: nowrap;
}

#payoutPanel button,
#fixedPayoutPanel button,
#endBallsPanel button:not(.input-clear-btn){
  width: 100%;
}

input:disabled{
  background: #e5e7eb;          
  color: #6b7280;               
  border-color: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.9;
}

.app-version{
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 4px rgba(2, 6, 23, 0.35);
  margin-top: -10px;
  margin-bottom: 12px;
}


.log-reset-btn{
  width: 100%;
  display: block;
  margin-top: 12px;
}


progress.goal-blue::-webkit-progress-value{
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}
progress.goal-yellow::-webkit-progress-value{
  background: linear-gradient(90deg, #fde68a, #f59e0b);
}
progress.goal-green::-webkit-progress-value{
  background: linear-gradient(90deg, #86efac, #16a34a);
}
progress.goal-red::-webkit-progress-value{
  background: linear-gradient(90deg, #fca5a5, #dc2626);
}
progress.goal-rainbow::-webkit-progress-value{
  background: linear-gradient(90deg, #ef4444, #f59e0b, #eab308, #22c55e, #3b82f6, #8b5cf6);
}


progress.goal-blue::-moz-progress-bar{
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}
progress.goal-yellow::-moz-progress-bar{
  background: linear-gradient(90deg, #fde68a, #f59e0b);
}
progress.goal-green::-moz-progress-bar{
  background: linear-gradient(90deg, #86efac, #16a34a);
}
progress.goal-red::-moz-progress-bar{
  background: linear-gradient(90deg, #fca5a5, #dc2626);
}
progress.goal-rainbow::-moz-progress-bar{
  background: linear-gradient(90deg, #ef4444, #f59e0b, #eab308, #22c55e, #3b82f6, #8b5cf6);
}

.invest-confirmed{
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: rgba(15,23,42,0.75);
}

.final-calc-preview{
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.42);
  color: #334155;
}

.final-calc-preview__label{
  margin-bottom: 4px;
  font-size: 0.84rem;
  font-weight: 800;
  color: #64748b;
}

.final-calc-preview__formula{
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.35;
  color: #0f172a;
  overflow-wrap: anywhere;
}



#finalCalcBtn{
  width: 100%;

  background: linear-gradient(
    180deg,
    #8fcf9f 0%,
    #5fa774 100%
  );

  color: #0f2a1f;
  border: 1px solid rgba(95,167,116,0.6);

  box-shadow:
    0 4px 0 rgba(74,133,92,0.7),
    0 12px 24px rgba(0,0,0,0.25);

  text-shadow: 0 1px 1px rgba(255,255,255,0.35);
}


.machine-fade{
  transition: opacity 0.25s ease;
}

.machine-fade.is-updating{
  opacity: 0;
}

.machine-fade.is-revealing{
  animation: machineReveal 0.55s ease-out forwards;
}

@keyframes machineReveal{
  from{
    opacity: 0;
    transform: translateY(-8px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce){
  .machine-fade.is-revealing{ animation: none; }
}


.chip.neutral{
  background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #1e3a8a;
  border: 1px solid rgba(30, 58, 138, 0.35);

  text-shadow: none;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.12);
}

.chip.neutral:hover{
  filter: brightness(1.03);
}

#midCheckCard {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(88vw, 420px); 
  max-height: calc(100vh - 118px - env(safe-area-inset-bottom));
  overflow-y: auto;
  z-index: 50;
  text-align: center;
}

#midCheckCard .section-title {
  text-align: center;
}

.mid-check-heading{
  position: relative;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mid-check-heading .section-title{
  margin: 0;
}

.mid-judge-inline{
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 104px;
  min-height: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-sizing: border-box;
  font-weight: 900;
  white-space: nowrap;
}

.mid-judge-inline.is-good{
  background: #dbeafe;
  border-color: rgba(185, 28, 28, 0.30);
}

.mid-judge-inline.is-bad{
  background: #fee2e2;
  border-color: rgba(29, 78, 216, 0.30);
}

.mid-judge-inline__mark{
  font-size: 1.22rem;
  line-height: 1;
}

.mid-judge-inline.is-good .mid-judge-inline__mark{
  color: #b91c1c;
}

.mid-judge-inline.is-bad .mid-judge-inline__mark{
  color: #1d4ed8;
}

.mid-judge-inline__text{
  color: #0f172a;
  font-size: 0.82rem;
  line-height: 1;
}

#midCheckResult{
  white-space: pre-line;
  line-height: 1.5;

  
  font-family: inherit;                 
  font-size: 0.95rem;
  color: var(--text);
  text-align: center;
  background: transparent;
  margin: 0;
  padding: 0;
  line-height: 1.45; 
  margin-bottom: 6px;
}



.chip-wide-thin {
  padding: 8px 22px;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  opacity: 0.9;
}


.chip-mid-check {
  background: linear-gradient(180deg, #fde68a 0%, #f59e0b 100%);
  color: #5a3a00;
  border-color: rgba(120, 70, 0, 0.35);
  text-shadow: 0 1px 1px rgba(255,255,255,0.4);
}

#midCheckCard {
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.25);
}


.rate-meter{
  margin: 10px 0 12px;
}

.rate-meter__scale{
  display:flex;
  justify-content: space-between;
  align-items:center;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: rgba(15,23,42,0.65);
}

.rate-meter__center{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.05;
}

.rate-meter__border-value{
  color: rgba(15,23,42,0.82);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.rate-meter__bar{
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
  overflow: hidden;
  position: relative;
}


.rate-meter__border{
  position:absolute;
  left: 50%;
  top: -3px;
  transform: translateX(-50%);
  width: 2px;
  height: calc(100% + 6px);
  opacity: 0.7;
  height: 26px;
  background: rgba(15,23,42,0.55);
  border-radius: 999px;
}


.rate-meter__needle{
  position:absolute;
  top: -10px;
  transform: translateX(-50%);
  width: 10px;
  height: 34px;
  border-radius: 999px;
  background: #f59e0b; 
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}


.rate-meter__labels{
  display:flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.75rem;
  color: rgba(15,23,42,0.55);
}


.rate-meter.is-hidden{ display:none; }

#midCheckClose{
  padding-left: 32px;
  padding-right: 32px;
  padding: 6px 32px;
  font-size: 0.8rem;   
  font-weight: 400;    
  display: block;
  margin: 10px auto 0;
  width: 60%;
}

#midCheckResult .mid-sub{
  font-size: 0.8rem;                 
  color: rgba(15,23,42,0.6);         
}

.mid-formula-preview{
  margin: 12px 0 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.42);
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}


.kv-list{
  display: grid;
  row-gap: 6px;
  margin: 12px auto 0;
  justify-content: start;
  width: fit-content;
  transform: translateX(-8px);
}

.kv-row{
  display: grid;
  grid-template-columns: minmax(7.5em, max-content) max-content;
  column-gap: 8px;
  align-items: baseline;
  white-space: nowrap;
  min-width: 0;
}

.kv-key{
  text-align: right;
  opacity: 0.75;
  white-space: nowrap;
}
.kv-key::after{
  content: "：";
}

.kv-val{
  text-align: left;
  font-weight: 600;
}


.kv-key {
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.7);
  font-weight: 400; 
  text-align: right;
  white-space: nowrap;
}

.kv-val {
  font-size: 1rem;
  font-weight: 400; 
  color: #0f172a;
  white-space: nowrap;
}


#midDiffVal {
  font-weight: 700;
}

#midDiffVal.is-plus {
  color: #2563eb; 
}

#midDiffVal.is-minus {
  color: #dc2626; 
}

.final-result{
  margin-top: 12px;
  white-space: pre-line;
  line-height: 1.5;
  color: rgba(15, 23, 42, 0.85);
  font-size: 0.95rem;
}

.rate-diff{
  font-weight: 800;
}

.rate-diff.is-plus{
  color: #2563eb;
}

.rate-diff.is-minus{
  color: #dc2626;
}


.rate-meter--compact{
  margin-top: 10px;
}

.rate-meter--compact .rate-meter__bar{
  height: 12px;          
}

.rate-meter--compact .rate-meter__scale{
  margin-bottom: 6px;
}

.rate-meter--compact .rate-meter__labels{
  margin-top: 6px;
  opacity: 0.8;
  font-size: 0.85rem;
}

.card-header {
  position: relative;
  display: flex;
  align-items: center;
}


.card-header .section-title {
  margin: 0;
  margin-left: auto;
}


.chip-icon {
  margin-left: auto;
  padding: 4px 8px;      
  font-size: 11px;
  height: 26px;
  line-height: 1;
  border-radius: 999px; 
  white-space: nowrap;  
}


.chip-midcheck-mini {
  padding: 4px 8px !important;
  font-size: 11px !important;
  height: 26px !important;
  min-width: auto !important;

  border-radius: 8px;
  box-shadow: none;
}


.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between; 
  flex-direction: row-reverse;
}

.card-header #btnMidCheck {
  margin-left: 0;        
}


#btnMidCheck {
  width: auto !important;
  min-width: unset !important;
  max-width: max-content;

  padding: 6px 14px;
  font-size: 14px;
  height: 30px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;
  background: linear-gradient(180deg, #ffd84d 0%, #f2b705 100%);
  color: #2b1f00;
  border-color: rgba(180, 130, 0, 0.38);
  text-shadow: none;
  box-shadow: 0 6px 14px rgba(90, 69, 0, 0.14);
}

#midCheckClose{
  flex: none;          
  width: auto;
  min-width: 88px;     
  padding: 10px 16px;
  align-self: center;  
}

.mid-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 40;
}

.mid-judge-popup{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 70;
  width: min(82vw, 330px);
  padding: 24px 22px 20px;
  border-radius: 18px;
  text-align: center;
  box-sizing: border-box;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.26);
}

.mid-judge-popup.is-good{
  background: #dbeafe;
  border-color: rgba(185, 28, 28, 0.26);
}

.mid-judge-popup.is-bad{
  background: #fee2e2;
  border-color: rgba(29, 78, 216, 0.26);
}

.mid-judge-popup__mark{
  font-size: clamp(5.2rem, 22vw, 8rem);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: 0;
}

.mid-judge-popup.is-good .mid-judge-popup__mark{
  color: #b91c1c;
}

.mid-judge-popup.is-bad .mid-judge-popup__mark{
  color: #1d4ed8;
}

.mid-judge-popup__text{
  margin: 12px 0 18px;
  color: #0f172a;
  font-size: 1.8rem;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
}

.mid-judge-popup__close{
  width: 100%;
  min-height: 48px;
}

.mid-balls-input{ margin: 10px 0 8px; }
#midBallsConfirm{ width: 100%; margin-bottom: 6px; }

.chip.undo{
  background: linear-gradient(180deg, #f3f6ff 0%, #d9e2ff 100%);
  color: #24304f;
  border: 1px solid rgba(79, 70, 229, 0.18);
  text-shadow: none;
  box-shadow: 0 7px 16px rgba(49, 46, 129, 0.10);
}

#favoriteBtn{
  width: auto;
  padding: 4px 9px;
  font-size: 12px;
  height: 25px;
  margin-top: 0;
  margin-bottom: 6px;
}

.exchange-label{
  width: 100%;
  box-sizing: border-box;
}

.exchange-row{
  display:flex;
  align-items:flex-end;
  gap:12px;
  grid-column: 1 / -1;
  grid-row: 3;
}

.store-row{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}

.store-heading{
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.store-heading > span{
  color: var(--text);
  font-weight: 700;
}

.store-heading-actions{
  display: grid;
  grid-template-columns: 76px 70px;
  gap: 6px;
  flex: none;
}

.store-row > label:first-of-type{
  grid-column: 1 / -1;
  grid-row: 2;
}

.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;
}

#storeSelect{
  display: none;
}

.store-picker-open{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  background: rgba(246, 249, 252, 1);
  color: var(--text);
  border: 1px solid var(--field-border);
  border-radius: var(--r-chip);
  box-shadow: none;
  text-align: left;
}

.store-row.is-store-selected .store-picker-open{
  cursor: default;
  pointer-events: none;
  opacity: 1;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

.store-row.is-store-selected .store-picker-open__hint{
  display: none;
}

#selectedStoreName{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-picker-open__hint{
  flex: none;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(38, 108, 203, 0.10);
  color: #1d4f95;
  font-size: 12px;
}

#storeChangeBtn{
  margin-top: 0;
}

#storeChangeBtn.is-reserved{
  visibility: hidden;
  pointer-events: none;
}

#storeAddBtn{
  margin-top: 0;
}

.store-row > label:nth-of-type(2){
  display: none;
}

.store-row .owned-summary{
  grid-column: 1 / -1;
  grid-row: 4;
}

.store-row.is-adding-store{
  grid-template-columns: auto auto 1fr;
  align-items: start;
}

.store-row.is-adding-store .store-heading,
.store-row.is-adding-store > label:first-of-type{
  display: none;
}

.store-row.is-adding-store > label:nth-of-type(2){
  display: block;
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
}

.store-row.is-adding-store .exchange-row{
  grid-row: 3;
}

.store-row.is-adding-store #storeSaveBtn{
  grid-column: 1;
  grid-row: 1;
}

.store-row.is-adding-store #storeCancelBtn{
  grid-column: 2;
  grid-row: 1;
}

.store-row.is-adding-store .owned-summary{
  grid-column: 1 / -1;
  grid-row: 5;
  width: 100%;
  box-sizing: border-box;
}

#storeAddBtn,
#storeChangeBtn,
#storeSaveBtn,
#storeCancelBtn{
  width: auto;
  min-width: 0;
  min-height: 30px;
  padding: 5px 7px;
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: none;
}

.owned-summary{
  min-width: 150px;
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  column-gap: 8px;
  row-gap: 3px;
  align-items: center;
}

.owned-summary span,
.owned-summary strong{
  display: block;
}

.owned-values,
.owned-edit{
  display: contents;
}

#dailyCashOnHand{
  grid-column: 1;
  grid-row: 1;
}

#ownedBalance{
  grid-column: 1;
  grid-row: 2;
}

#currentHandBalls{
  grid-column: 1;
  grid-row: 3;
}

#dailyCashSaveBtn{
  grid-column: 2;
  grid-row: 1;
}

#ownedBalanceSaveBtn{
  grid-column: 2;
  grid-row: 2;
}

.owned-summary strong{
  margin-top: 0;
}

.current-hand-balls{
  margin-top: 0;
  font-weight: 400;
  color: rgba(15, 23, 42, 0.68);
}

#ownedBalanceSaveBtn,
#dailyCashSaveBtn{
  width: auto;
  min-width: 88px;
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
  line-height: 1.15;
  box-shadow: none;
}

#storeAddBtn,
#storeChangeBtn,
#ownedBalanceSaveBtn,
#dailyCashSaveBtn{
  background: linear-gradient(180deg, #e7f7ff 0%, #bfe9fb 100%);
  color: #075985;
  border: 1px solid rgba(14, 116, 144, 0.35);
  text-shadow: none;
}

#storeAddBtn:hover,
#storeChangeBtn:hover,
#ownedBalanceSaveBtn:hover,
#dailyCashSaveBtn:hover{
  filter: brightness(1.04);
}

#ownedBalanceSaveBtn:disabled,
#ownedBalanceSaveBtn.is-disabled{
  background: linear-gradient(180deg, #f1f5f9 0%, #d8e0ea 100%);
  color: #94a3b8;
  border-color: rgba(100, 116, 139, 0.24);
  box-shadow: none;
  opacity: 1;
  cursor: default;
  filter: none;
}

#ownedBalanceSaveBtn:disabled:hover,
#ownedBalanceSaveBtn.is-disabled:hover{
  filter: none;
}

.store-picker-overlay{
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.42);
}

.store-picker-modal{
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 70;
  width: min(760px, 100vw);
  max-height: min(78vh, 680px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
  padding: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -20px 42px rgba(2, 6, 23, 0.28);
}

.store-picker-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.store-picker-header h2{
  margin: 0;
  font-size: 1.05rem;
}

.store-picker-close{
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.95);
  color: #334155;
  box-shadow: none;
}

.store-picker-list{
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.store-picker-item{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.store-picker-select{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(246, 249, 252, 0.95);
  color: var(--text);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
  text-align: left;
}

.store-picker-item.is-current .store-picker-select{
  border-color: rgba(242, 183, 5, 0.75);
  background: rgba(255, 248, 215, 0.95);
}

.store-picker-select span{
  color: rgba(15, 23, 42, 0.62);
  font-size: 12px;
}

.store-picker-delete{
  width: 38px;
  padding: 0;
  border-radius: 999px;
  background: rgba(254, 226, 226, 0.9);
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.20);
  box-shadow: none;
  font-size: 20px;
  line-height: 1;
}

.store-picker-empty{
  margin: 20px 0;
  color: rgba(15, 23, 42, 0.62);
  text-align: center;
}

#favoriteBtn{
  position: absolute;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf3 0%, #fff6c9 100%);
  color: #6b5708;
  border: 1px solid rgba(211, 172, 39, 0.30);
  box-shadow: 0 4px 10px rgba(90, 69, 0, 0.08);
}

#favoriteBtn.is-favorite{
  background: linear-gradient(180deg, #ffe999 0%, #ffc928 58%, #e6a800 100%);
  color: #4b3600;
  border-color: rgba(180, 130, 0, 0.50);
  box-shadow: 0 8px 18px rgba(180, 130, 0, 0.22);
}

#favoriteBtn.is-sparkling{
  animation: favorite-pop 420ms ease-out;
}

#favoriteBtn.is-sparkling::after{
  content: "";
  position: absolute;
  inset: -40% auto -40% -35%;
  width: 42%;
  transform: rotate(22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.85), transparent);
  animation: favorite-shine 520ms ease-out;
}

@keyframes favorite-pop{
  0%{ transform: scale(1); }
  45%{ transform: scale(1.06); }
  100%{ transform: scale(1); }
}

@keyframes favorite-shine{
  0%{ left: -35%; opacity: 0; }
  25%{ opacity: 1; }
  100%{ left: 115%; opacity: 0; }
}

@keyframes ev-calc-pulse{
  0%{
    filter: brightness(1);
    box-shadow:
      0 4px 0 rgba(20, 74, 150, 0.62),
      0 14px 26px rgba(2, 6, 23, 0.20);
  }
  42%{
    filter: brightness(1.20) saturate(1.12);
    box-shadow:
      0 4px 0 rgba(20, 74, 150, 0.50),
      0 0 0 5px rgba(255, 216, 77, 0.26),
      0 0 30px rgba(255, 232, 112, 0.42),
      0 0 42px rgba(59, 130, 246, 0.48),
      0 18px 30px rgba(2, 6, 23, 0.24);
  }
  100%{
    filter: brightness(1);
    box-shadow:
      0 4px 0 rgba(20, 74, 150, 0.62),
      0 14px 26px rgba(2, 6, 23, 0.20);
  }
}

@keyframes ev-calc-burst{
  0%{
    transform: scale(0.72);
    opacity: 0;
  }
  18%{
    opacity: 1;
  }
  46%{
    opacity: 0.88;
  }
  100%{
    transform: scale(1.22);
    opacity: 0;
  }
}

@keyframes ev-calc-ring{
  0%{
    transform: scale(0.98);
    opacity: 0;
  }
  22%{
    opacity: 1;
  }
  100%{
    transform: scale(1.08);
    opacity: 0;
  }
}

#playOwnedBtn,
#ownedUseBtn{
  background: linear-gradient(180deg, #4fb6a2 0%, #178a7b 55%, #0f5f59 100%);
  color: #ffffff;
  border: 1px solid rgba(15, 95, 89, 0.42);
  text-shadow: 0 1px 2px rgba(2, 44, 41, 0.30);
  box-shadow: 0 8px 18px rgba(15, 95, 89, 0.18);
}

#playOutputBtn{
  background: linear-gradient(180deg, #6597f2 0%, #2f63c6 55%, #1e3f91 100%);
  color: #ffffff;
  border: 1px solid rgba(30, 64, 175, 0.42);
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.30);
  box-shadow: 0 8px 18px rgba(30, 64, 175, 0.18);
}

#playCashBtn{
  background: linear-gradient(180deg, #dfb44f 0%, #a77224 52%, #794916 100%);
  color: #ffffff;
  border: 1px solid rgba(134, 91, 28, 0.42);
  text-shadow: 0 1px 2px rgba(45, 28, 8, 0.32);
  box-shadow: 0 8px 18px rgba(86, 54, 18, 0.18);
}

#playCashBtn.is-active{
  background: linear-gradient(180deg, #e6bf5c 0%, #aa7728 52%, #7d4c18 100%);
  color: #ffffff;
  border-color: rgba(134, 91, 28, 0.46);
}

#calcBtn,
#ownedUseBtn{
  width: 100%;
  min-height: 60px;
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--r-control);
  font-size: 16px;
  font-weight: 800;
}

#playOwnedBtn.is-active{
  background: linear-gradient(180deg, #58c2ae 0%, #1a9383 55%, #126760 100%);
  color: #ffffff;
  border-color: rgba(216, 189, 82, 0.70);
}

#playOutputBtn.is-active{
  background: linear-gradient(180deg, #78a7ff 0%, #376fd1 55%, #23499d 100%);
  color: #ffffff;
  border-color: rgba(216, 189, 82, 0.70);
}

#skipInvest{
  background: linear-gradient(180deg, #f8fafc 0%, #dbe5ef 100%);
  color: #334155;
  border: 1px solid rgba(71, 85, 105, 0.28);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10);
}

#finalCalcBtn{
  background: linear-gradient(180deg, #348fe8 0%, #1155aa 100%);
  color: #ffffff;
  border: 1px solid rgba(29, 78, 216, 0.34);
  box-shadow:
    0 4px 0 rgba(20, 74, 150, 0.62),
    0 14px 26px rgba(2, 6, 23, 0.20);
  text-shadow: 0 1px 2px rgba(0,0,0,0.28);
  position: relative;
  overflow: hidden;
}

#finalCalcBtn.is-ev-flashing{
  animation: ev-calc-pulse 620ms ease-out forwards;
}

#finalCalcBtn.is-ev-flashing::before{
  content: "";
  position: absolute;
  inset: -20%;
  border-radius: inherit;
  opacity: 0;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.92) 0%, rgba(255,232,112,0.68) 22%, rgba(83,171,255,0.36) 48%, rgba(37,99,235,0) 74%);
  animation: ev-calc-burst 520ms ease-out forwards;
  mix-blend-mode: screen;
  pointer-events: none;
}

#finalCalcBtn.is-ev-flashing::after{
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  opacity: 0;
  border: 2px solid rgba(255, 232, 112, 0.58);
  box-shadow:
    0 0 14px rgba(255, 232, 112, 0.48),
    0 0 28px rgba(59, 130, 246, 0.38);
  animation: ev-calc-ring 560ms ease-out forwards;
  pointer-events: none;
}

.play-source-tabs{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.output-source-wrap{
  display: grid;
  grid-template-columns: minmax(112px, 1fr) minmax(128px, 1fr);
  align-items: stretch;
  gap: 10px;
  grid-column: 1 / -1;
}

.invest-hand-balance{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: var(--r-chip);
  border: 1px solid rgba(30, 64, 175, 0.24);
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.play-source-tabs .chip.is-active{
  outline: 3px solid rgba(255, 216, 77, 0.45);
  filter: brightness(1.04);
}

.exchange-label{
  font-size: 0.85rem;
}

.exchange-label select{
  font-size: 16px; 
}

#rushEndAdjustRow{
  grid-column: 1 / -1;
  margin-top: 8px;
}

#totalCard > p,
#totalCard > .goal,
#totalCard > .note,
#totalCard > #resetBtn{
  display: none;
}

.machine-total-cards{
  display: grid;
  gap: 12px;
}

.machine-total-card{
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 8px;
  background: rgba(246, 249, 252, 0.9);
  padding: 12px;
}

.machine-total-card.is-current{
  border-color: rgba(242, 183, 5, 0.55);
  box-shadow: inset 0 0 0 2px rgba(255, 216, 77, 0.22);
}

.machine-total-card__title{
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.35;
}

.machine-total-card p{
  margin: 8px 0;
}

.machine-total-card__outcomes{
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 8px 0;
  color: rgba(15, 23, 42, 0.74);
}

.machine-total-card__outcomes p{
  display: grid;
  grid-template-columns: 4.5em 1fr;
  column-gap: 8px;
  align-items: baseline;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.machine-total-card__outcome-label{
  color: rgba(15, 23, 42, 0.68);
}

.machine-total-card__outcome-value{
  font-variant-numeric: tabular-nums;
}

.machine-total-card__payout-average{
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(15, 23, 42, 0.82);
}

.machine-total-card__metric{
  display: grid;
  grid-template-columns: 7.4em 1em minmax(0, 1fr);
  column-gap: 0;
  align-items: baseline;
  font-size: 1rem;
  line-height: 1.45;
  color: rgba(15, 23, 42, 0.86);
}

.machine-total-card__metric-label{
  color: rgba(15, 23, 42, 0.72);
  white-space: nowrap;
  text-align: left;
}

.machine-total-card__metric-colon{
  color: rgba(15, 23, 42, 0.72);
  text-align: center;
}

.machine-total-card__metric-value{
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.machine-total-card__metric--ev{
  font-size: 18px;
  font-weight: 800;
}

.machine-total-card__metric--ev .machine-total-card__metric-label,
.machine-total-card__metric--ev .machine-total-card__metric-colon{
  color: rgba(15, 23, 42, 0.92);
}

.machine-total-card__metric--invest{
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(15, 23, 42, 0.72);
}

.machine-total-card--summary .machine-total-card__ev{
  font-size: 20px;
}

.machine-total-card__goal-label{
  font-weight: 700;
  color: rgba(15, 23, 42, 0.78);
}

.machine-reset-btn{
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  font-size: 14px;
  background: rgba(255,255,255,0.86);
  color: rgba(15, 23, 42, 0.75);
  box-shadow: 0 8px 16px rgba(2, 6, 23, 0.10);
}

.data-tools-card{
  display: none !important;
  padding: 14px;
}

body.is-total-all-mode .data-tools-card{
  display: block !important;
}

body.is-total-selected-mode .data-tools-card{
  display: none !important;
}

.data-tools-note{
  margin: 8px 0 12px;
  color: rgba(15, 23, 42, 0.68);
  font-size: 13px;
  line-height: 1.55;
}

.data-tools-actions{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.data-tools-actions .chip{
  min-height: 44px;
  padding: 10px 12px;
  font-size: 14px;
}

.legal-links{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  font-size: 12px;
}

.legal-links a{
  color: rgba(15, 23, 42, 0.62);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page{
  max-width: 760px;
  margin: 0 auto;
}

.legal-page .card{
  line-height: 1.75;
}

.legal-page h1{
  margin: 0 0 12px;
  color: #ffffff;
  text-align: center;
  font-size: 28px;
  text-shadow: 0 2px 10px rgba(2, 6, 23, 0.36);
}

.legal-page h2{
  margin: 22px 0 8px;
  font-size: 18px;
}

.legal-page p,
.legal-page li{
  color: rgba(15, 23, 42, 0.78);
}

.legal-page ul{
  padding-left: 1.2em;
}

.legal-page__back{
  display: inline-flex;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
  text-decoration: none;
}

.affiliate-links{
  margin: 6px 0 18px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.20);
  color: rgba(255,255,255,0.78);
}

.affiliate-links__header{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.affiliate-links__header h2{
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.82);
}

.affiliate-links__header span{
  font-size: 11px;
  color: rgba(255,255,255,0.54);
}

.affiliate-links__list{
  display: grid;
  gap: 8px;
}

.affiliate-link{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.affiliate-link:last-child{
  border-bottom: 0;
}

.affiliate-link__body{
  min-width: 0;
}

.affiliate-link__title{
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.affiliate-link__description{
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255,255,255,0.56);
}

.affiliate-link__arrow{
  color: rgba(255, 216, 77, 0.82);
  font-size: 16px;
}

.bottom-tabs{
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 60;
  width: min(520px, calc(100vw - 24px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.bottom-tab{
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  box-shadow: none;
  border-color: rgba(255,255,255,0.14);
}

.bottom-tab.is-active{
  background: linear-gradient(180deg, #ffd84d 0%, #f2b705 100%);
  color: #2b1f00;
}

@media (max-width: 560px){
  .store-row{
    grid-template-columns: 1fr;
  }

  .owned-summary{
    min-width: 0;
  }

  .data-tools-actions{
    grid-template-columns: 1fr;
  }
}

