/* ==========================================================================
   VISUAL PORTFOLIO & CHESS SYSTEM — BLACK OPS ONE MILITARY TACTICAL STYLING
   Color Palette:
   - Vanilla Cream : #f0ead2
   - Cream         : #dde5b6
   - Muted Olive   : #adc178
   - Faded Copper  : #a98467
   - Ash Brown     : #6c584c
   ========================================================================== */

:root {
  /* Color Tokens */
  --vanilla-cream: #f0ead2;
  --cream: #dde5b6;
  --muted-olive: #adc178;
  --faded-copper: #a98467;
  --ash-brown: #6c584c;

  /* Typography */
  --font-main: 'Black Ops One', cursive, sans-serif;

  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Global Transitions */
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* GLOBAL RESETS */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-main);
  letter-spacing: 0.03em;
}

body {
  background-color: var(--vanilla-cream);
  color: var(--ash-brown);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ENTRY MODAL OVERLAY */
.entry-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(108, 88, 76, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.entry-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.entry-modal-card {
  background: #ffffff;
  border: 3px solid var(--muted-olive);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  max-width: 460px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(108, 88, 76, 0.4), 0 0 30px rgba(173, 193, 120, 0.3);
  animation: modalScale 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  background: var(--cream);
  color: var(--ash-brown);
  border: 1px solid var(--faded-copper);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.entry-modal-card h2 {
  font-size: 1.5rem;
  color: var(--ash-brown);
  text-transform: uppercase;
  margin-bottom: 10px;
  line-height: 1.2;
}

.entry-modal-card p {
  font-size: 0.8rem;
  color: var(--ash-brown);
  opacity: 0.85;
  line-height: 1.5;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.btn-modal {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
}

.btn-play {
  background: var(--muted-olive);
  color: var(--ash-brown);
  border: 2px solid var(--ash-brown);
}

.btn-play:hover {
  background: var(--cream);
}

.btn-direct {
  background: var(--vanilla-cream);
  color: var(--ash-brown);
  border: 2px solid var(--faded-copper);
}

.btn-direct:hover {
  background: var(--cream);
}

/* MAIN DASHBOARD WRAPPER */
.dashboard-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  max-width: 1100px;
  width: 95vw;
  height: 90vh;
  max-height: 640px;
}

/* LEFT CARD: Portfolio Panel */
.portfolio-card {
  flex: 1;
  height: 100%;
  background-color: #ffffff;
  border: 2px solid var(--faded-copper);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(108, 88, 76, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 16px 24px;
  border-bottom: 2px solid var(--vanilla-cream);
  background: var(--vanilla-cream);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  background-color: var(--muted-olive);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--muted-olive);
}

.logo-text {
  font-size: 1rem;
  font-weight: 400;
  color: var(--ash-brown);
  text-transform: uppercase;
}

/* TAB NAVIGATION BAR (NO EMOJIS) */
.portfolio-tabs {
  display: flex;
  background: var(--vanilla-cream);
  border-bottom: 2px solid var(--faded-copper);
  width: 100%;
}

.tab-btn {
  flex: 1;
  padding: 10px 2px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ash-brown);
  opacity: 0.7;
  font-size: 0.64rem;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  text-transform: uppercase;
}

.tab-btn:hover:not(.locked) {
  opacity: 1;
  background: var(--cream);
}

.tab-btn.active {
  opacity: 1;
  color: var(--ash-brown);
  border-bottom-color: var(--muted-olive);
  background: #ffffff;
}

.tab-btn.locked {
  color: var(--faded-copper);
  cursor: not-allowed;
  opacity: 0.5;
}

.tab-lock-dot {
  width: 5px;
  height: 5px;
  background-color: var(--faded-copper);
  border-radius: 50%;
}

.tab-btn:not(.locked) .tab-lock-dot {
  display: none;
}

/* SCROLLABLE STEP AREA */
.portfolio-content-scroller {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  position: relative;
}

.content-step {
  display: none;
}

.content-step.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  background: var(--cream);
  color: var(--ash-brown);
  border: 1px solid var(--faded-copper);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.step-badge.victory {
  background: var(--muted-olive);
  color: #ffffff;
}

.step-title {
  font-size: 1.4rem;
  color: var(--ash-brown);
  line-height: 1.25;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.text-gradient {
  color: var(--faded-copper);
}

.step-description {
  font-size: 0.8rem;
  color: var(--ash-brown);
  opacity: 0.85;
  line-height: 1.5;
  margin-bottom: 18px;
}

.instruction-box {
  background: var(--vanilla-cream);
  border-left: 4px solid var(--muted-olive);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
}

.box-title {
  font-size: 0.75rem;
  color: var(--ash-brown);
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

.instruction-box p {
  font-size: 0.72rem;
  color: var(--ash-brown);
  opacity: 0.85;
  line-height: 1.4;
}

/* STATS GRID */
.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--vanilla-cream);
  border: 1px solid var(--faded-copper);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat-card .num {
  display: block;
  font-size: 1.2rem;
  color: var(--ash-brown);
  margin-bottom: 2px;
}

.stat-card .label {
  font-size: 0.6rem;
  color: var(--faded-copper);
  text-transform: uppercase;
}

.prompt-to-move {
  background: var(--cream);
  border: 1px solid var(--muted-olive);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.7rem;
  color: var(--ash-brown);
  text-align: center;
  text-transform: uppercase;
}

/* PROJECTS LIST */
.project-cards-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.project-item {
  background: var(--vanilla-cream);
  border-left: 4px solid var(--muted-olive);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--faded-copper);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.project-item h3 {
  font-size: 0.9rem;
  color: var(--ash-brown);
  margin-bottom: 4px;
}

.project-item p {
  font-size: 0.72rem;
  color: var(--ash-brown);
  opacity: 0.8;
}

/* SKILLS SPLIT BOX */
.skills-split-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.skills-block {
  background: var(--vanilla-cream);
  border: 1px solid var(--faded-copper);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.skills-block h5 {
  font-size: 0.75rem;
  color: var(--faded-copper);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.skills-block ul {
  list-style: none;
}

.skills-block li {
  font-size: 0.7rem;
  color: var(--ash-brown);
  margin-bottom: 4px;
}

/* CONTACT FORM */
.compact-contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.input-row {
  display: flex;
  gap: 8px;
}

.compact-contact-form input,
.compact-contact-form textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--vanilla-cream);
  border: 1px solid var(--faded-copper);
  border-radius: var(--radius-sm);
  color: var(--ash-brown);
  font-size: 0.75rem;
}

.compact-contact-form input:focus,
.compact-contact-form textarea:focus {
  outline: none;
  border-color: var(--muted-olive);
}

.btn-submit {
  background: var(--muted-olive);
  color: var(--ash-brown);
  border: 2px solid var(--ash-brown);
  padding: 8px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-transform: uppercase;
  transition: var(--transition);
}

.btn-submit:hover {
  background: var(--cream);
}

.mail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faded-copper);
  text-decoration: none;
  font-size: 0.72rem;
}

.panel-footer {
  padding: 12px 24px;
  border-top: 2px solid var(--vanilla-cream);
  background: var(--vanilla-cream);
}

.copyright {
  font-size: 0.65rem;
  color: var(--ash-brown);
  opacity: 0.7;
}

/* RIGHT CARD: Chess Console Panel */
.chess-card {
  flex: 1;
  height: 100%;
  background-color: var(--ash-brown);
  color: var(--vanilla-cream);
  border: 2px solid var(--faded-copper);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(108, 88, 76, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.chess-console-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* MATCH PROGRESS TRACKER */
.match-progress-container {
  width: 378px;
  background: rgba(240, 234, 210, 0.08);
  border: 1px solid var(--faded-copper);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.progress-label {
  font-size: 0.6rem;
  color: var(--cream);
  text-transform: uppercase;
}

.progress-val {
  font-size: 0.65rem;
  color: var(--muted-olive);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--muted-olive);
  transition: width 0.4s ease;
}

/* Centered Board Housing */
.chessboard-container-centered {
  display: flex;
  justify-content: center;
  align-items: center;
}

.chessboard-border {
  position: relative;
  border: 4px solid var(--faded-copper);
  border-radius: var(--radius-md);
  padding: 8px;
  background: var(--ash-brown);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* Board Overlay before starting */
.board-overlay {
  position: absolute;
  inset: 0;
  background: rgba(108, 88, 76, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: 4px;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  opacity: 1;
  visibility: visible;
}

.board-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay-card {
  text-align: center;
  padding: 16px;
}

.overlay-card h3 {
  font-size: 1rem;
  color: var(--vanilla-cream);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.overlay-card p {
  font-size: 0.72rem;
  color: var(--cream);
}

/* Chessboard (360px) */
.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 45px);
  grid-template-rows: repeat(8, 45px);
  border-radius: 4px;
  overflow: hidden;
  width: 360px;
  height: 360px;
}

.chess-square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
}

/* Customized Palette Board Colors */
.chess-square.light {
  background-color: var(--vanilla-cream);
}

.chess-square.dark {
  background-color: var(--muted-olive);
}

.chess-square .coord-label {
  position: absolute;
  font-size: 7px;
  opacity: 0.6;
}

.chess-square.light .coord-label { color: var(--ash-brown); }
.chess-square.dark .coord-label { color: var(--vanilla-cream); }

.coord-label.rank { left: 3px; top: 3px; }
.coord-label.file { right: 3px; bottom: 3px; }

/* Move helpers & highlights */
.move-dot {
  width: 14px;
  height: 14px;
  background-color: var(--muted-olive);
  box-shadow: 0 0 6px rgba(173, 193, 120, 0.9);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
}

.move-dot-capture {
  width: 40px;
  height: 40px;
  border: 4px solid var(--faded-copper);
  box-shadow: 0 0 8px rgba(169, 132, 103, 0.7);
  border-radius: 50%;
  position: absolute;
  pointer-events: none;
  z-index: 10;
}

/* Highlight Trails & Selection */
.chess-square.selected {
  background-color: var(--cream) !important;
  box-shadow: inset 0 0 0 3px var(--muted-olive);
}

.chess-square.last-move-src,
.chess-square.last-move-dst {
  background-color: rgba(221, 229, 182, 0.75) !important;
}

/* Error Flash Animation */
.chess-square.error-flash {
  background-color: rgba(169, 132, 103, 0.8) !important;
  animation: shake 0.35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Pieces inside 45px square */
.chess-piece {
  width: 38px;
  height: 38px;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chess-piece img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

/* TACTICAL INTEL COMMENTARY BANNER */
.tactical-commentary-box {
  width: 378px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--muted-olive);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.commentary-tag {
  display: block;
  font-size: 0.55rem;
  color: var(--faded-copper);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.tactical-commentary-box p {
  font-size: 0.68rem;
  color: var(--vanilla-cream);
  line-height: 1.3;
}

/* Bottom Control Panel (Two Rows) */
.chess-control-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 378px;
  background: rgba(240, 234, 210, 0.08);
  border: 1px solid var(--faded-copper);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.panel-row-1 {
  width: 100%;
}

.panel-row-1 .control-levels {
  display: flex;
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid var(--faded-copper);
}

.panel-row-1 .level-pill-horizontal {
  flex: 1;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--vanilla-cream);
  font-size: 0.7rem;
  text-transform: uppercase;
  transition: var(--transition);
}

.panel-row-1 .level-pill-horizontal:hover {
  color: var(--cream);
}

.panel-row-1 .level-pill-horizontal.active {
  background: var(--muted-olive);
  color: var(--ash-brown);
}

.panel-row-2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border-top: 1px solid rgba(240, 234, 210, 0.1);
  padding-top: 6px;
}

.control-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

#status-text {
  font-size: 0.7rem;
  color: var(--vanilla-cream);
  text-transform: uppercase;
}

/* Status light pulse */
.status-pulse-light {
  width: 8px;
  height: 8px;
  background-color: var(--faded-copper);
  border-radius: 50%;
}

.status-pulse-light.ready {
  background-color: var(--muted-olive);
}

.status-pulse-light.thinking {
  background-color: var(--cream);
}

.control-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-badge {
  font-size: 0.68rem;
  color: var(--cream);
  text-transform: uppercase;
}

.level-badge span {
  color: var(--muted-olive);
}

.reset-action-btn {
  background: transparent;
  border: 1px solid var(--faded-copper);
  color: var(--vanilla-cream);
  padding: 3px 8px;
  font-size: 0.62rem;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: var(--transition);
}

.reset-action-btn:hover:not(:disabled) {
  background: var(--faded-copper);
  color: var(--vanilla-cream);
}

.reset-action-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ==========================================================================
   ULTRA-RESPONSIVE MOBILE & TABLET ADAPTATION SYSTEM
   ========================================================================== */

@media (max-width: 990px) {
  body {
    overflow-y: auto;
    height: auto;
    padding: 16px 0;
  }

  .dashboard-wrapper {
    flex-direction: column;
    height: auto;
    max-height: none;
    padding: 0 14px;
    gap: 20px;
    width: 100%;
  }

  .portfolio-card {
    width: 100%;
    height: 440px;
  }

  .chess-card {
    width: 100%;
    height: auto;
    padding: 20px 14px;
  }
}

@media (max-width: 600px) {
  .portfolio-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .portfolio-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    min-width: 78px;
    font-size: 0.62rem;
    padding: 12px 4px;
  }

  .chess-board {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 1 / 1;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
  }

  .chess-square {
    width: 100%;
    height: 100%;
  }

  .chess-piece {
    width: 82%;
    height: 82%;
  }

  .chess-control-panel,
  .match-progress-container,
  .tactical-commentary-box {
    width: 100%;
    max-width: 320px;
  }

  .modal-actions {
    flex-direction: column;
    gap: 10px;
  }

  .btn-modal {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .chess-board {
    max-width: 280px;
  }
  .chess-control-panel,
  .match-progress-container,
  .tactical-commentary-box {
    max-width: 280px;
  }
  .step-title {
    font-size: 1.2rem;
  }
}
