/* Shinobi Eternal — combat (mise en page shinobi.fr) */
body:has(.official-combat),
body.theme-day:has(.official-combat),
body.theme-night:has(.official-combat),
body.theme-classic:has(.official-combat) {
  background: #1a1a1a !important;
  color: #eee !important;
}
body:has(.official-combat) #app { background: #1a1a1a; }

.official-combat {
  min-height: 100vh;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 0 12px 40px;
  font-family: "Trebuchet MS", Tahoma, Arial, sans-serif;
  background: #1a1a1a;
}

.oc-alert {
  text-align: center;
  margin: 0 0 8px;
  padding: 12px 20px;
  background: linear-gradient(90deg, transparent 0%, rgba(4, 4, 4, .7) 25%, rgba(4, 4, 4, .8) 50%, rgba(4, 4, 4, .7) 75%, transparent 100%);
}
.oc-alert strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: #fff;
}
.oc-alert p { margin: 0; font-size: 13px; color: #ddd; }

.oc-fighters {
  position: relative;
  padding: 18px 16px 16px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, transparent 0%, rgba(4, 4, 4, .7) 25%, rgba(4, 4, 4, .8) 50%, rgba(4, 4, 4, .7) 75%, transparent 100%);
}

.oc-fighters-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 8px;
}
.oc-pname, .oc-ename {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  min-width: 0;
}
.oc-pname { text-align: right; padding-right: 10px; }
.oc-ename { text-align: left; padding-left: 10px; color: #ff9a4d; }
.oc-pname.chikara { color: #ff6b5b; }
.oc-pname.mahou { color: #5b9bff; }
.oc-pname.gensou { color: #c9a8ff; }

.oc-versus {
  flex: 0 0 auto;
  background: #080a0b;
  color: #bbb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .28em;
  padding: 8px 28px;
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
}
.oc-versus .short { display: none; }

.oc-fighters-content {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 190px;
  gap: 8px;
  align-items: end;
}

.oc-fighter { position: relative; }
.oc-fighter.player {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  justify-content: flex-start;
}
.oc-fighter.enemy {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  position: relative;
}
.oc-monster-wrap {
  width: 148px;
  min-height: 132px;
  display: grid;
  place-items: end center;
  position: relative;
}
.oc-fighter.enemy .oc-side {
  position: absolute;
  right: 0;
  bottom: 8px;
  padding: 0;
  z-index: 2;
}

.oc-portrait {
  width: 110px;
  height: 148px;
  margin: -36px 0 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  display: grid;
  place-items: end center;
}
.official-combat .oc-portrait .ninja-portrait,
.official-combat .ninja-portrait {
  width: 110px !important;
  height: 148px !important;
  max-width: 110px;
  background: transparent !important;
}

.oc-monster-gif, .oc-creature {
  max-width: 148px;
  max-height: 148px;
  object-fit: contain;
  image-rendering: auto;
}
.oc-creature {
  width: 118px;
  height: 132px;
  display: grid;
  place-items: center;
  font-size: 64px;
}

.oc-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 4px;
}
.oc-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  width: fit-content;
  white-space: nowrap;
}
.oc-badge.offensive { color: #ff6b6b; background: rgba(255, 107, 107, .15); }
.oc-badge.defensive { color: #5e9bff; background: rgba(94, 155, 255, .15); }
.oc-badge.neutral { color: #ccc; background: rgba(255, 255, 255, .08); }
.oc-badge.fuyarde { color: #c9a8ff; background: rgba(201, 168, 255, .15); }
.oc-badge.element { color: #ffa94d; background: rgba(255, 169, 77, .15); border: 1px solid rgba(255, 169, 77, .45); }

.oc-equip { display: flex; flex-direction: column; gap: 4px; }
.eq-row { display: flex; gap: 4px; }
.eq-icon {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #bbb;
  font-size: 14px;
}
.eq-icon img, .eq-icon .item-art-icon { width: 26px; height: 26px; object-fit: contain; }

.oc-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 8px;
}
.oc-metric {
  --c: #ff7058;
  display: grid;
  grid-template-columns: minmax(28px, 1fr) 52px minmax(92px, auto) 52px minmax(28px, 1fr);
  align-items: center;
  gap: 8px;
}
.oc-metric.def { --c: #5e9bff; }
.oc-metric.agi { --c: #c9a8ff; }
.oc-metric.hp { --c: #8fd694; }
.oc-metric.chakra { --c: #7ec8ff; }
.oc-metric-label {
  color: var(--c);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.oc-val {
  color: var(--c);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.oc-val.left { text-align: right; }
.oc-val.right { text-align: left; }
.oc-bar {
  height: 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
  min-width: 0;
}
.oc-bar > span {
  display: block;
  height: 100%;
  background: var(--c);
  border-radius: inherit;
  transition: width .45s ease;
}
.oc-bar.left { display: flex; justify-content: flex-end; }
.oc-metric.hp .oc-bar, .oc-metric.chakra .oc-bar { height: 10px; }

.oc-log {
  margin: 16px 0;
  padding: 4px 0 8px;
  background: linear-gradient(90deg, transparent 0%, rgba(4, 4, 4, .7) 25%, rgba(4, 4, 4, .8) 50%, rgba(4, 4, 4, .7) 75%, transparent 100%);
}
.oc-round { padding: 0 16px; }
.oc-round-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}
.oc-round .act {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: #ff6b4a;
}
.oc-round .act.dodge, .oc-round .act.sub, .oc-round .act.flee { color: #c9a8ff; }
.oc-round .act.parry { color: #5e9bff; }
.oc-round .act-p { text-align: right; }
.oc-round .act-e { text-align: left; }
.oc-round .score {
  flex: 0 0 48px;
  background: rgba(0, 0, 0, .4);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 0;
  text-align: center;
  border-radius: 4px;
}
.oc-round .score.miss { color: #aaa; }
.oc-round .tag {
  flex: 0 0 auto;
  padding: 0 16px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.oc-round-details {
  display: flex;
  gap: 8px;
  padding: 0 16px 10px;
  color: #ccc;
  font-size: 11px;
}
.oc-round-details .d-p { flex: 1; text-align: right; }
.oc-round-details .d-c { flex: 0 0 auto; padding: 0 16px; }
.oc-round-details .d-e { flex: 1; text-align: left; }

.oc-total {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
}
.oc-total b {
  flex: 0 0 48px;
  background: rgba(0, 0, 0, .4);
  color: #fff;
  padding: 8px 0;
  text-align: center;
  border-radius: 4px;
}
.oc-total span { color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .12em; }

.oc-next {
  margin: 10px 0 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  color: #eee;
}

.oc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 4px 8px 16px;
}
.oc-card {
  position: relative;
  width: 86px;
  height: 112px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  cursor: pointer;
  box-shadow: inset 0 1px #ffffff33, 0 6px 14px #0006;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 6px 0;
  transition: transform .15s ease, filter .15s ease;
}
.oc-card:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.08); }
.oc-card:disabled { opacity: .42; cursor: not-allowed; filter: grayscale(.25); }
.oc-card.attack { background: linear-gradient(180deg, #e05645, #a33228); }
.oc-card.parry { background: linear-gradient(180deg, #4d78d8, #2b478c); }
.oc-card.dodge, .oc-card.flee, .oc-card.sub { background: linear-gradient(180deg, #7a57c9, #4a3486); }
.oc-card.jutsu { background: linear-gradient(180deg, #d6b14a, #a07c1f); }
.oc-card .ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0004;
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 8px;
}
.oc-card strong { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.15; }
.oc-card em {
  font-style: normal;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 800;
}
.oc-card .chakra {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #3aa0d8;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 10px;
}
.oc-key {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #0005;
  font-size: 10px;
  display: grid;
  place-items: center;
}

.oc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #bbb;
  font-size: 12px;
  min-height: 28px;
}
.oc-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #666;
  border-top-color: #fff;
  border-radius: 50%;
  animation: ocSpin .7s linear infinite;
}

.oc-end { text-align: center; padding: 8px 16px 0; }
.oc-end h2 {
  margin: 8px 0 6px;
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: none;
}
.oc-end .sum { color: #ccc; font-size: 13px; }
.oc-end .sum strong {
  display: inline-block;
  margin-top: 6px;
  background: rgba(0, 0, 0, .4);
  padding: 6px 28px;
  border-radius: 4px;
  color: #fff;
}
.oc-rewards { max-width: 640px; margin: 18px auto 0; }
.oc-rewards h3 { font-size: 13px; letter-spacing: .08em; margin: 0 0 12px; font-weight: 600; }
.oc-reward-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.oc-reward {
  background: rgba(0, 0, 0, .4);
  padding: 6px 10px;
  border-radius: 6px;
  min-width: 110px;
}
.oc-reward small { display: block; color: #888; font-size: 10px; text-transform: none; }
.oc-reward b { display: block; margin-top: 4px; color: #e6b23a; }
.oc-reward.bonus b { color: #c86adf; }
.oc-return {
  display: block;
  width: min(520px, 100%);
  margin: 22px auto 0;
  background: #cfcfcf;
  color: #222;
  border: 0;
  padding: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.oc-return:hover { filter: brightness(1.05); }

.official-combat.resolving .oc-fighter.player { animation: ocIdle .8s ease; }
.official-combat.hit-player .oc-fighter.player { animation: ocShake .35s ease; }
.official-combat.hit-enemy .oc-fighter.enemy { animation: ocShake .35s ease; }

@keyframes ocRoundIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ocSpin { to { transform: rotate(360deg); } }
@keyframes ocShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
@keyframes ocIdle { 50% { filter: brightness(1.08); } }

@media (max-width: 720px) {
  .oc-versus .full { display: none; }
  .oc-versus .short { display: inline; }
  .oc-versus { padding: 8px 18px; letter-spacing: .12em; }
  .oc-pname, .oc-ename { font-size: 16px; }
  .oc-fighters-content { grid-template-columns: 1fr 1fr; }
  .oc-metrics { grid-column: 1 / -1; }
  .oc-metric {
    grid-template-columns: 0 55px minmax(90px, 1fr) 55px 0;
    gap: 4px;
  }
  .oc-bar { display: none; }
  .oc-fighter.player, .oc-fighter.enemy { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .oc-bar > span, .oc-card, .oc-round { animation: none; transition: none; }
}

.history-replay-screen {
  background: #2d2d2c !important;
  padding-bottom: 96px;
  width: min(980px, 100%);
}
body:has(.history-replay-screen),
body:has(.history-replay-screen) #app {
  background: #2d2d2c !important;
}
.history-replay-screen .oc-pname small {
  display: inline;
  margin-left: 8px;
  color: #888;
  font-size: 12px;
  font-weight: 600;
}
.replay-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(20,20,25,.95) 0%, rgba(10,10,15,.98) 100%);
  border-top: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 -4px 20px rgba(0,0,0,.5);
}
.replay-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}
.history-replay-screen .replay-bar-content .btn {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 18px !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  transform: none !important;
  filter: none !important;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.history-replay-screen .btn.btn-back {
  background: rgba(255,255,255,.1) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  color: #ccc !important;
}
.history-replay-screen .btn.btn-share {
  background: linear-gradient(135deg, rgba(100,140,200,.25), rgba(60,100,160,.25)) !important;
  border: 1px solid rgba(100,140,200,.4) !important;
  color: #9cf !important;
}
.history-replay-screen .btn.btn-favorite {
  background: rgba(255,255,255,.1) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  color: #ccc !important;
}
.history-replay-screen .btn.btn-favorite.is-favorite {
  background: rgba(255,193,7,.2) !important;
  border-color: #ffc10780 !important;
  color: #ffc107 !important;
}
.history-replay-screen .btn.btn-report {
  width: 40px;
  min-width: 40px;
  padding: 0 !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  color: #aaa !important;
}
.replay-bar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-replay-screen .replay-bar-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.08) !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  box-shadow: none !important;
  color: #aaa !important;
  font-size: 13px;
  transform: none !important;
  filter: none !important;
}
.history-replay-screen .replay-bar-btn.play-btn {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(100,180,100,.3), rgba(60,140,60,.3)) !important;
  border-color: #64b46466 !important;
  color: #8f8 !important;
  font-size: 16px;
}
.replay-bar-progress {
  min-width: 50px;
  margin-left: 8px;
  color: #888;
  font-size: 13px;
  text-align: center;
}
.replay-bar-progress b { color: #fff; }
.replay-bar-date {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.1);
  color: #666;
  font-size: 11px;
  white-space: nowrap;
}
.replay-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-replay-screen .replay-sprite {
  width: 90px;
  height: 110px;
  object-fit: contain;
  object-position: center top;
}
@media (max-width: 820px) {
  .replay-bar-content { flex-wrap: wrap; justify-content: center; }
  .replay-bar-date { display: none; }
}
