@font-face {
  font-family: 'ImpactWeb';
  src: url('/wp-content/uploads/fonts/impact.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Container and layout */
.mtg-ring-counter .app-container {
  width: 100%;
  min-width: min(360px, 90vw) !important;
  min-height: min(360px, 90vh) !important;
  max-width: min(90vw, 90vh, 500px);
  aspect-ratio: 1;
}

.mtg-ring-counter #ringCounterContainer {
  width: 100%;
  height: 100%;
  position: relative;
}

.mtg-ring-counter #menu {
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.mtg-ring-counter #menu > svg {
  z-index: 1 !important;
}

/* Inner circle - responsive container */
.mtg-ring-counter #innerCircle {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  background: none !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  z-index: 5 !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  aspect-ratio: 1 / 1 !important;
  overflow: visible !important;
}

.mtg-ring-counter #innerCircle * {
  box-sizing: border-box;
}

.mtg-ring-counter [id$="_innerCircle"] {
  overflow: hidden !important;
}

.mtg-ring-counter .menu-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.mtg-ring-counter #menu svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mtg-ring-counter #menu svg path,
.mtg-ring-counter #menu svg text,
.mtg-ring-counter #menu svg image {
  pointer-events: auto;
}


/* Assigning Font */
.mtg-ring-counter .central-number,
.mtg-ring-counter .central-label,
.mtg-ring-counter .interactive-circle-item,
.mtg-ring-counter .central-player-name {
    font-family: 'ImpactWeb', Impact, 'Arial Black', Arial, sans-serif !important;
    white-space: nowrap;
}


/* Central display styles */
.mtg-ring-counter .central-display {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 120 !important;
  text-align: center !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease, transform 0.3s ease !important;
  width: 90% !important;
  max-width: 250px !important;
}

.mtg-ring-counter .central-player-name {
  font-size: 21px;
  font-weight: regular !important;
  color: var(--counter-color, #4CAF50) !important;
  text-shadow: 
    0 0 15px var(--counter-glow, rgba(76, 175, 80, 0.4)),
    1px 1px 2px rgba(0, 0, 0, 0.8) !important;
  user-select: none !important;
  transition: all 0.2s ease !important;
  line-height: 1 !important;
  margin-bottom: 8px !important;
  letter-spacing: 1px !important;
  opacity: 0.9 !important;
}

.mtg-ring-counter .central-number {
  font-weight: normal !important;
  color: var(--counter-color, #4CAF50) !important;
  text-shadow: 
    0 0 20px var(--counter-glow, rgba(76, 175, 80, 0.4)),
    0 0 40px var(--counter-glow-light, rgba(76, 175, 80, 0.2)),
    2px 2px 4px rgba(0, 0, 0, 0.8) !important;
  user-select: none !important;
  line-height: 0.9 !important;
  margin-bottom: -5px !important;
  opacity: 1;
  transition: opacity 0.25s ease;
}


.mtg-ring-counter .central-label {
  font-weight: normal !important;
  color: var(--counter-color, #4CAF50) !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
  letter-spacing: 2px !important;
  margin-top: 5px !important;
  opacity: 0.8 !important;
}



/* ===============================
   INACTIVE PLAYER – MINIMAL VIEW
   =============================== */

/* Hide everything except the number */
.player-wrapper.inactive .central-player-name,
.player-wrapper.inactive .central-label {
  display: none !important;
}


/* Hide interactive UI */
.player-wrapper.inactive .upper-half-zone,
.player-wrapper.inactive .lower-half-zone,
.player-wrapper.inactive .center-circle-zone {
  display: none !important;
}

/* Hide digit wheel entirely for inactive players */
.player-wrapper.inactive .digit-wheel-container {
  display: none !important;
}

/* Keep the number centered and clean */
.player-wrapper.inactive .central-display {
  margin: 0 !important;
}

.player-wrapper.inactive .central-number {
  opacity: 0.95;
  letter-spacing: -0.03em;
}

/* Hide the mini numbers around the inner circle for inactive players */
.player-wrapper.inactive .interactive-circle-item {
  display: none !important;
}

/* (Optional) if any other interactive-circle bits appear */
.player-wrapper.inactive .interactive-circle-main,
.player-wrapper.inactive .interactive-circle-center {
  pointer-events: none !important;
}


/* Interactive Circle Styles */
.mtg-ring-counter .interactive-circle-main {
  border-radius: 50%;
  position: relative;
  background: none;
  aspect-ratio: 1 / 1 !important;
}

.mtg-ring-counter .interactive-circle-center {
  display: none !important;
}

.mtg-ring-counter .interactive-circle-item {
  position: absolute;

  min-width: 2.4ch;
  height: 1.6em;

  font-size: clamp(14px, 3.5vw, 18px);
  font-weight: normal;
  color: white;

  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  
  display: flex;
  align-items: center;
  justify-content: center;

  line-height: 1;
  letter-spacing: 0.02em;

  transform: translate(-50%, -50%);
}


/* Interactive Zones */
.mtg-ring-counter .upper-half-zone,
.mtg-ring-counter .lower-half-zone,
.mtg-ring-counter .center-circle-zone {
  position: absolute;
  cursor: pointer;
  transition: background-color 0.2s ease;
  z-index: 150 !important;
}

.mtg-ring-counter .upper-half-zone {
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  clip-path: circle(62% at 50% 100%);
}

.mtg-ring-counter .lower-half-zone {
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  clip-path: circle(62% at 50% 0%);
}

.mtg-ring-counter .center-circle-zone {
  top: 50%;
  left: 50%;
  width: 20%;
  height: 20%;
  margin-left: -10%;
  margin-top: -10%;
  border-radius: 50%;
  background: transparent;
  z-index: 200 !important;
}

.mtg-ring-counter .upper-half-zone,
.mtg-ring-counter .lower-half-zone {
  width: 100%;
  height: 50%;
  left: 0;
  right: 0;
  position: absolute;
  pointer-events: auto;
}

.mtg-ring-counter .upper-half-zone {
  top: 0;
  border-top-left-radius: 999px;
  border-top-right-radius: 999px;
}

.mtg-ring-counter .lower-half-zone {
  bottom: 0;
  border-bottom-left-radius: 999px;
  border-bottom-right-radius: 999px;
}

.upper-half-zone,
.lower-half-zone,
.center-circle-zone {
  z-index: 1;
}

.central-display {
  position: relative;
  z-index: 10;
}

/* Hover effects */
.mtg-ring-counter .upper-half-zone:hover {
  background: linear-gradient(0deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.15) 100%);
}

.mtg-ring-counter .lower-half-zone:hover {
  background: linear-gradient(0deg, 
    rgba(255, 255, 255, 0.15) 0%, 
    transparent 100%);
}

/* Overlay layer (off by default) */
.mtg-ring-counter .upper-half-zone::before,
.mtg-ring-counter .lower-half-zone::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;

  opacity: 0;
  transition: opacity 80ms ease;
  pointer-events: none;
}

/* Upper = GREEN */
.mtg-ring-counter .upper-half-zone.is-pressed::before {
  opacity: 1;
  background: linear-gradient(180deg,
    rgba(76, 175, 80, 0.60) 0%,
    rgba(76, 175, 80, 0.35) 55%,
    rgba(76, 175, 80, 0.00) 100%);
}

/* Lower = RED */
.mtg-ring-counter .lower-half-zone.is-pressed::before {
  opacity: 1;
  background: linear-gradient(0deg,
    rgba(244, 67, 54, 0.55) 0%,
    rgba(244, 67, 54, 0.30) 55%,
    rgba(244, 67, 54, 0.00) 100%);
}

.mtg-ring-counter .upper-half-zone,
.mtg-ring-counter .lower-half-zone,
.mtg-ring-counter .center-circle-zone {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}



.mtg-ring-counter .center-circle-zone:active {
  background: rgba(255, 255, 255, 0.2);
}

/* Kill the mobile tap highlight / focus flash */
.mtg-ring-counter,
.mtg-ring-counter * {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
}

/* IMPORTANT: do NOT change your existing layout sizing rules here */
.mtg-ring-counter .upper-half-zone,
.mtg-ring-counter .lower-half-zone {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;

  /* Needed for the overlay */
  position: relative;
  overflow: hidden;
}


/* Change animations */
.mtg-ring-counter .change-animation {
  position: absolute;
  top: 25%;
  right: 20%;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: bold;
  z-index: 135;
  pointer-events: none;
  animation: changeAnim 0.8s ease-out forwards;
}

.mtg-ring-counter .change-animation.up {
  color: #4CAF50;
  text-shadow: 0 0 15px rgba(76, 175, 80, 0.8);
  top: 30%;
}

.mtg-ring-counter .change-animation.down {
  color: #F44336;
  text-shadow: 0 0 15px rgba(244, 67, 54, 0.8);
  top: 60%;
}

@keyframes changeAnim {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-15px) scale(1.3);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
}

/* Digit Wheel Counter */
.mtg-ring-counter .digit-wheel-container {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: inline-flex;
  gap: clamp(2px, 0.5vw, 8px);
  align-items: center;
  justify-content: center;
  z-index: 300 !important;
  transition: all 0.3s ease !important;
}

.mtg-ring-counter .digit-wheel-container.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) scale(0.8) !important;
  visibility: hidden !important;
}

.mtg-ring-counter .digit-wheel-container.visible {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translate(-50%, -50%) scale(1) !important;
  visibility: visible !important;
  background: rgba(0, 0, 0, 0.9) !important;
  border-radius: 15px !important;
  padding: clamp(6px, 1.5vw, 10px) !important;
  border: none !important;
  box-shadow: 
    0 0 20px rgba(0, 0, 0, 0.8),
    0 0 40px var(--counter-glow, rgba(76, 175, 80, 0.6)) !important;
  backdrop-filter: blur(5px) !important;
  transition: all 0.3s ease !important;
}

.mtg-ring-counter .digit-wheel-container.visible .digit-wheel-wheel {
  pointer-events: auto !important;
  z-index: 201 !important;
  position: relative;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.5),
    inset 0 3px 0 rgba(255, 255, 255, 0.15),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3);
}

.mtg-ring-counter .digit-wheel-container.visible .digit-wheel-strip {
  pointer-events: auto !important;
  z-index: 202 !important;
  position: relative;
}

.mtg-ring-counter .digit-wheel-container.visible .digit-wheel-digit {
  pointer-events: auto !important;
  position: relative;
}

.mtg-ring-counter .digit-wheel-wheel {
  position: relative;
  width: clamp(32px, 7vw, 60px);
  height: clamp(80px, 18vw, 130px);
  border-radius: clamp(4px, 1vw, 8px);
  margin: 0 !important;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  background: linear-gradient(180deg, 
    var(--counter-bg, rgba(76, 175, 80, 0.2)) 0%, 
    var(--counter-bg-light, rgba(76, 175, 80, 0.1)) 50%, 
    var(--counter-bg, rgba(76, 175, 80, 0.2)) 100%);
  border: 2px solid var(--counter-border, rgba(76, 175, 80, 0.5));
}

.mtg-ring-counter .digit-wheel-wheel:hover {
  transform: scale(1.05);
  border-color: var(--counter-color, #4CAF50);
  box-shadow: 0 6px 20px var(--counter-bg, rgba(76, 175, 80, 0.4)), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.mtg-ring-counter .digit-wheel-digit {
  height: clamp(34px, 7vw, 56px);
  font-size: clamp(18px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  position: relative;
  color: var(--counter-color, #4CAF50);
  text-shadow: 0 0 10px var(--counter-glow, rgba(76, 175, 80, 0.6)), 2px 2px 4px rgba(0, 0, 0, 0.5);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.mtg-ring-counter .digit-wheel-digit.active {
  text-shadow: 0 0 15px var(--counter-glow, rgba(76, 175, 80, 0.6)), 
               0 0 25px var(--counter-glow-light, rgba(76, 175, 80, 0.4)), 
               2px 2px 4px rgba(0, 0, 0, 0.7);
  transform: scale(1.1);
}

.mtg-ring-counter .digit-wheel-input {
  background: transparent;
  border: none;
  font-size: clamp(24px, 6vw, 36px);
  font-weight: bold;
  text-align: center;
  outline: none;
  width: clamp(60px, 15vw, 80px);
  color: var(--counter-color, #4CAF50);
  text-shadow: 0 0 15px var(--counter-glow, rgba(76, 175, 80, 0.6));
}

.mtg-ring-counter .digit-wheel-strip {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateY(0);
}

.mtg-ring-counter .digit-wheel-center-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--counter-color, #4CAF50);
  opacity: 0.3;
  z-index: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.mtg-ring-counter .digit-wheel-digit.fade-1 {
  opacity: 0.6;
  transform: scale(0.9);
}

.mtg-ring-counter .digit-wheel-digit.fade-2 {
  opacity: 0.3;
  transform: scale(0.8);
}

.mtg-ring-counter .digit-wheel-digit.fade-3 {
  opacity: 0.1;
  transform: scale(0.7);
}

.mtg-ring-counter .hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .mtg-ring-counter .app-container {
    min-width: 280px;
    min-height: 280px;
  }
  
  .mtg-ring-counter .central-player-name {
    margin-bottom: clamp(6px, 1.5vmin, 10px) !important;
  }

  .mtg-ring-counter .center-circle-zone {
    width: 30%;
    height: 30%;
    margin-left: -15%;
    margin-top: -15%;
  }

  .mtg-ring-counter .change-animation {
    font-size: 18px !important;
  }
  
  .mtg-ring-counter .digit-wheel-container {
    gap: 2px;
  }
}

@media (max-width: 320px) {
  .mtg-ring-counter .app-container {
    min-width: 250px;
    min-height: 250px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .mtg-ring-counter .app-container {
    min-width: 350px;
    min-height: 350px;
  }
}

@media (max-width: 768px) {

  /* Slightly larger center target for thumbs */
  .mtg-ring-counter .center-circle-zone {
    width: 26%;
    height: 26%;
    margin-left: -13%;
    margin-top: -13%;
  }
  
  /* Make digit wheels thumb-friendly */
  .mtg-ring-counter .digit-wheel-wheel {
    width: clamp(44px, 14vw, 72px);
    height: clamp(110px, 30vw, 160px);
    border-radius: 10px;
  }

  .mtg-ring-counter .digit-wheel-digit {
    height: clamp(44px, 12vw, 64px);
    font-size: clamp(22px, 6vw, 36px);
  }

  .mtg-ring-counter .digit-wheel-container.visible {
    padding: 6px !important;
  }

} 
  
/* Counter type specific CSS custom properties */
.mtg-ring-counter[data-counter="health"] {
  --counter-color: #4CAF50;
  --counter-glow: rgba(76, 175, 80, 0.6);
  --counter-glow-light: rgba(76, 175, 80, 0.4);
  --counter-bg: rgba(76, 175, 80, 0.2);
  --counter-bg-light: rgba(76, 175, 80, 0.1);
  --counter-border: rgba(76, 175, 80, 0.5);
}

.mtg-ring-counter[data-counter="poison"] {
  --counter-color: #E91E63;
  --counter-glow: rgba(233, 30, 99, 0.6);
  --counter-glow-light: rgba(233, 30, 99, 0.4);
  --counter-bg: rgba(233, 30, 99, 0.2);
  --counter-bg-light: rgba(233, 30, 99, 0.1);
  --counter-border: rgba(233, 30, 99, 0.5);
}

.mtg-ring-counter[data-counter="energy"] {
  --counter-color: #FFEB3B;
  --counter-glow: rgba(255, 235, 59, 0.6);
  --counter-glow-light: rgba(255, 235, 59, 0.4);
  --counter-bg: rgba(255, 235, 59, 0.2);
  --counter-bg-light: rgba(255, 235, 59, 0.1);
  --counter-border: rgba(255, 235, 59, 0.5);
}

.mtg-ring-counter[data-counter="experience"] {
  --counter-color: #9C27B0;
  --counter-glow: rgba(156, 39, 176, 0.6);
  --counter-glow-light: rgba(156, 39, 176, 0.4);
  --counter-bg: rgba(156, 39, 176, 0.2);
  --counter-bg-light: rgba(156, 39, 176, 0.1);
  --counter-border: rgba(156, 39, 176, 0.5);
}

.mtg-ring-counter[data-counter="speed"] {
  --counter-color: #FF5722;
  --counter-glow: rgba(255, 87, 34, 0.6);
  --counter-glow-light: rgba(255, 87, 34, 0.4);
  --counter-bg: rgba(255, 87, 34, 0.2);
  --counter-bg-light: rgba(255, 87, 34, 0.1);
  --counter-border: rgba(255, 87, 34, 0.5);
}

.mtg-ring-counter[data-counter="casts"] {
  --counter-color: #FFFFFF;
  --counter-glow: rgba(255, 255, 255, 0.6);
  --counter-glow-light: rgba(255, 255, 255, 0.4);
  --counter-bg: rgba(255, 255, 255, 0.2);
  --counter-bg-light: rgba(255, 255, 255, 0.1);
  --counter-border: rgba(255, 255, 255, 0.5);
}