
    * {
      box-sizing: border-box;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    body {
      margin: 0;
      background: radial-gradient(circle at top, #1e293b 0, #020617 55%, #000 100%);
      color: #e5e7eb;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      padding: 16px;
    }

    .game-wrapper {
      display: flex;
      flex-direction: column;
      gap: 16px;
      max-width: 1000px;
      width: 100%;
    }

    @media (min-width: 840px) {
      .game-wrapper {
        flex-direction: row;
        align-items: flex-start;
      }
    }

    .game-container,
    .profile-container {
      background: rgba(15, 23, 42, 0.95);
      border-radius: 18px;
      padding: 20px 22px 24px;
      box-shadow: 0 18px 40px rgba(0,0,0,0.7);
      border: 1px solid #1f2937;
    }

    .game-container {
      flex: 0 0 auto;
    }

    .profile-container {
      flex: 2;
    }

    h1 {
      font-size: 1.4rem;
      margin-bottom: 4px;
    }

    .subtitle {
      font-size: 0.9rem;
      color: #9ca3af;
      margin-bottom: 12px;
    }

    .top-bar {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
      font-size: 0.85rem;
    }

    .top-item {
      flex: 1;
      padding: 8px 10px;
      border-radius: 10px;
      background: #020617;
      border: 1px solid #111827;
    }

    .top-label {
      color: #9ca3af;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .top-value {
      margin-top: 4px;
      font-weight: 700;
    }

    #time {
      font-size: 1.1rem;
    }

    #best-score {
      color: #f97316;
    }

    .score-wrapper {
      margin: 8px 0 8px;
    }

    .score-label {
      font-size: 0.9rem;
      color: #9ca3af;
    }

    .score-value {
      font-size: 3rem;
      font-weight: 700;
      margin: 4px 0 0;
      color: #facc15;
      text-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
    }

    .target-wrapper {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 6px;
      font-size: 1rem;
      color: #9ca3af;
      flex-wrap: wrap;
    }

    .target-label-strong {
      font-weight: 600;
      color: #e5e7eb;
    }

    .current-target-value {
      padding: 3px 10px;
      border-radius: 999px;
      background: #0f172a;
      border: 1px solid #1f2937;
      font-weight: 700;
      color: #facc15;
    }

    .target-meta {
      font-size: 0.78rem;
      color: #9ca3af;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-bottom: 10px;
    }

    .target-meta span {
      white-space: nowrap;
    }

    .target-difficulty-easy {
      color: #22c55e;
    }

    .target-difficulty-medium {
      color: #eab308;
    }

    .target-difficulty-hard {
      color: #f97316;
    }

    .target-difficulty-crazy {
      color: #ef4444;
    }

    .target-hint {
      font-size: 0.78rem;
      color: #6b7280;
      width: 100%;
    }

    button {
      border: none;
      border-radius: 999px;
      padding: 10px 18px;
      cursor: pointer;
      font-size: 0.95rem;
      font-weight: 600;
      transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.12s ease, opacity 0.12s;
    }

    button:active {
      transform: scale(0.95);
      box-shadow: none;
    }

    button:disabled {
      opacity: 0.45;
      cursor: default;
      transform: none;
      box-shadow: none;
    }

    .btn-start {
      background: linear-gradient(135deg, #22c55e, #16a34a);
      color: #022c22;
      box-shadow: 0 4px 16px rgba(34,197,94,0.55);
      width: 100%;
      margin-bottom: 10px;
    }

    .btn-start:hover:not(:disabled) {
      background: linear-gradient(135deg, #16a34a, #15803d);
    }

    .btn-main {
      background: #22c55e;
      color: #022c22;
      box-shadow: 0 4px 14px rgba(34,197,94,0.5);
    }

    .btn-main:hover:not(:disabled) {
      background: #16a34a;
    }

    .btn-secondary {
      background: #3b82f6;
      color: #eff6ff;
      box-shadow: 0 4px 14px rgba(59,130,246,0.5);
    }

    .btn-secondary:hover:not(:disabled) {
      background: #2563eb;
    }

    .btn-reset {
      background: #64748b;
      color: #e5e7eb;
    }

    .btn-reset:hover:not(:disabled) {
      background: #475569;
    }

    .buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      justify-content: center;
      margin-top: 8px;
    }

    #message {
      margin-top: 10px;
      font-size: 0.85rem;
      min-height: 1.2em;
    }

    .message-good {
      color: #22c55e;
    }

    .message-new-best {
      color: #facc15;
    }

    .message-neutral {
      color: #9ca3af;
    }

    .message-levelup {
      color: #38bdf8;
    }

    .info {
      margin-top: 10px;
      font-size: 0.8rem;
      color: #9ca3af;
      line-height: 1.4;
    }

    .profile-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 10px;
    }

    .avatar {
      width: 40px;
      height: 40px;
      border-radius: 999px;
      background: radial-gradient(circle at 30% 20%, #facc15 0, #f97316 40%, #ea580c 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      color: #0b1120;
      font-size: 1.1rem;
    }

    .profile-title {
      font-size: 1rem;
      font-weight: 600;
    }

    .profile-subtitle {
      font-size: 0.8rem;
      color: #9ca3af;
    }

    .profile-level-row {
      margin-top: 10px;
      font-size: 0.9rem;
    }

    .xp-bar-wrapper {
      margin-top: 6px;
      width: 100%;
      height: 8px;
      border-radius: 999px;
      background: #020617;
      border: 1px solid #0f172a;
      overflow: hidden;
    }

    .xp-bar {
      height: 100%;
      width: 0%;
      border-radius: 999px;
      background: linear-gradient(90deg, #22c55e, #eab308);
      transition: width 0.2s ease;
    }

    .xp-text {
      font-size: 0.75rem;
      color: #9ca3af;
      margin-top: 4px;
    }

    .stats-list {
      margin-top: 14px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .stat-item {
      font-size: 0.85rem;
    }

    .stat-header {
      display: flex;
      justify-content: space-between;
      margin-bottom: 2px;
    }

    .stat-label {
      color: #e5e7eb;
    }

    .stat-value {
      color: #9ca3af;
    }

    .stat-bar-wrapper {
      width: 100%;
      height: 7px;
      background: #020617;
      border-radius: 999px;
      border: 1px solid #0f172a;
      overflow: hidden;
    }

    .stat-bar {
      height: 100%;
      width: 50%;
      border-radius: 999px;
      background: linear-gradient(90deg, #38bdf8, #6366f1);
      transition: width 0.2s ease;
    }

    .profile-note {
      margin-top: 10px;
      font-size: 0.75rem;
      color: #6b7280;
    }

    .role-section {
      margin-top: 16px;
      padding-top: 10px;
      border-top: 1px dashed #1f2937;
    }

    .role-label {
      font-size: 0.85rem;
      margin-bottom: 4px;
    }

    .role-select {
      width: 100%;
      margin-bottom: 4px;
      border-radius: 999px;
      padding: 6px 10px;
      border: 1px solid #1f2937;
      background: #020617;
      color: #e5e7eb;
      font-size: 0.85rem;
      outline: none;
    }

    .role-select:focus {
      border-color: #22c55e;
    }

    .role-description {
      font-size: 0.75rem;
      color: #9ca3af;
      min-height: 2.4em;
    }

    .quests-section {
      margin-top: 14px;
      padding-top: 10px;
      border-top: 1px dashed #1f2937;
    }

    .quests-title {
      font-size: 0.9rem;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .quests-subtitle {
      font-size: 0.75rem;
      color: #9ca3af;
      margin-bottom: 6px;
    }

    .quest-list-title {
      font-size: 0.8rem;
      color: #9ca3af;
      margin: 4px 0;
    }

    .quest-item {
      background: #020617;
      border-radius: 10px;
      padding: 8px 10px;
      border: 1px solid #111827;
      margin-bottom: 6px;
      font-size: 0.78rem;
    }

    .quest-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 2px;
      gap: 8px;
    }

    .quest-title {
      font-weight: 600;
    }

    .quest-status {
      font-size: 0.7rem;
      padding: 2px 8px;
      border-radius: 999px;
      border: 1px solid #4b5563;
      color: #e5e7eb;
      white-space: nowrap;
    }

    .quest-status.done {
      border-color: #22c55e;
      color: #bbf7d0;
    }

    .quest-status.locked {
      border-color: #f97316;
      color: #fed7aa;
    }

    .quest-status.active {
      border-color: #38bdf8;
      color: #bae6fd;
    }

    .quest-progress {
      color: #9ca3af;
      margin-bottom: 4px;
    }

    .quest-extra {
      font-size: 0.72rem;
      color: #6b7280;
    }

    .btn-quest-start {
      font-size: 0.72rem;
      padding: 4px 10px;
      background: #22c55e;
      color: #022c22;
      margin-top: 4px;
    }

    .btn-quest-start:hover:not(:disabled) {
      background: #16a34a;
    }

    .rest-section {
      margin-top: 14px;
      padding-top: 10px;
      border-top: 1px dashed #1f2937;
      font-size: 0.8rem;
    }

    .rest-title {
      font-size: 0.9rem;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .rest-status-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 4px;
    }

    .rest-status-label {
      color: #e5e7eb;
    }

    .rest-status-value {
      font-weight: 600;
    }

    .rest-bar-wrapper {
      width: 100%;
      height: 7px;
      background: #020617;
      border-radius: 999px;
      border: 1px solid #0f172a;
      overflow: hidden;
      margin-bottom: 4px;
    }

    .rest-bar {
      height: 100%;
      width: 0%;
      border-radius: 999px;
      background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
      transition: width 0.2s ease;
    }

    .rest-suggestion {
      color: #9ca3af;
      margin-bottom: 6px;
    }

    .rest-meta {
      color: #6b7280;
      font-size: 0.75rem;
      margin-bottom: 6px;
    }

    .btn-rest {
      background: #0ea5e9;
      color: #e0f2fe;
      box-shadow: 0 3px 10px rgba(14,165,233,0.4);
      width: 100%;
      font-size: 0.8rem;
      padding: 7px 10px;
    }

    .btn-rest:hover:not(:disabled) {
      background: #0284c7;
    }

    .shop-section {
      margin-top: 14px;
      padding-top: 10px;
      border-top: 1px dashed #1f2937;
      font-size: 0.8rem;
    }

    .shop-title {
      font-size: 0.9rem;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .shop-subtitle {
      font-size: 0.75rem;
      color: #9ca3af;
      margin-bottom: 6px;
    }

    .shop-items {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .shop-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #020617;
      border-radius: 10px;
      padding: 6px 8px;
      border: 1px solid #111827;
    }

    .shop-item-text {
      font-size: 0.78rem;
      color: #e5e7eb;
    }

    .shop-item-text span {
      display: block;
    }

    .shop-item-text .shop-item-desc {
      color: #9ca3af;
      font-size: 0.73rem;
    }

    .shop-cost {
      font-size: 0.75rem;
      color: #fde68a;
      margin-right: 6px;
    }

    .btn-shop {
      font-size: 0.75rem;
      padding: 5px 10px;
      background: #22c55e;
      color: #022c22;
    }

    .btn-shop:hover:not(:disabled) {
      background: #16a34a;
    }

    .events-section {
      margin-top: 14px;
      padding-top: 10px;
      border-top: 1px dashed #1f2937;
      font-size: 0.8rem;
    }

    .events-title {
      font-size: 0.9rem;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .event-last {
      font-size: 0.8rem;
      color: #e5e7eb;
      background: #020617;
      border-radius: 10px;
      padding: 6px 8px;
      border: 1px solid #111827;
      min-height: 36px;
      margin-bottom: 6px;
    }

    .event-log-title {
      font-size: 0.75rem;
      color: #9ca3af;
      margin-top: 4px;
    }

    .event-log-list {
      list-style: none;
      padding: 0;
      margin: 4px 0 0;
      max-height: 120px;
      overflow-y: auto;
    }

    .event-log-item {
      font-size: 0.75rem;
      color: #9ca3af;
      margin-bottom: 3px;
    }

    .event-log-time {
      color: #6b7280;
      margin-right: 4px;
    }

    /* Precizitás szekció */

    .precision-section {
      margin-top: 14px;
      padding-top: 8px;
      border-top: 1px dashed #1f2937;
    }

    .precision-title {
      font-size: 0.85rem;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .precision-bar-wrapper {
      width: 100%;
      height: 7px;
      background: #020617;
      border-radius: 999px;
      border: 1px solid #0f172a;
      overflow: hidden;
      margin-bottom: 4px;
    }

    .precision-bar {
      height: 100%;
      width: 0%;
      border-radius: 999px;
      background: linear-gradient(90deg, #22c55e, #38bdf8, #a855f7);
      transition: width 0.2s ease;
    }

    .precision-text {
      font-size: 0.75rem;
      color: #9ca3af;
    }

    /* Life Coin szekció */

    .life-coin-section {
      margin-top: 14px;
      padding-top: 8px;
      border-top: 1px dashed #1f2937;
      font-size: 0.8rem;
    }

    .life-coin-title {
      font-size: 0.85rem;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .life-coin-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 4px;
    }

    .life-coin-label {
      color: #e5e7eb;
    }

    .life-coin-value {
      font-weight: 700;
      color: #a5b4fc;
    }

    .life-coin-desc {
      font-size: 0.75rem;
      color: #9ca3af;
    }

    .extra-container {
      background: rgba(15, 23, 42, 0.95);
      border-radius: 18px;
      padding: 20px 22px 24px;
      box-shadow: 0 18px 40px rgba(0,0,0,0.7);
      border: 1px solid #1f2937;
      flex: 3;
      min-height: 100%;
    }

    /* Bal oldali oszlop: game + kártyák egymás alatt */
    .left-column {
      flex: 3;                 /* ugyanaz az arány, mint eddig a game-container */
      display: flex;
      flex-direction: column;
      gap: 16px;
      }

    /* Új, bal alsó konténer – ugyanaz a stílus, mint a game-container */
    .cards-container {
      background: rgba(15, 23, 42, 0.95);
      border-radius: 18px;
      padding: 20px 22px 24px;
      box-shadow: 0 18px 40px rgba(0,0,0,0.7);
      border: 1px solid #1f2937;
      margin-top: auto;  
      flex: 1 1 auto;              /* kitölti a game alatti üres teret */
    }

    /* Desktop nézetben a két oszlop legyen egyformán magas */
    @media (min-width: 840px) {
      .game-wrapper {
        flex-direction: flex;
        align-items: stretch;
      }
    }

      .cards-title {
        font-size: 1rem;
        font-weight: 700;
        margin-bottom: 10px;
        color: #a5b4fc;
        text-align: center;
        letter-spacing: 0.03em;
    }

/* Kártyák rácsban */
      .cards-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
      }


/* Egyes kártyák */
      .card-item {
        background: linear-gradient(145deg, #0b1120, #1e293b);
        border: 1px solid #334155;
        border-radius: 12px;
        width: 100%;                /* grid szélesség tölti ki */
        aspect-ratio: 1 / 2;        /* <-- 1:2 arány */
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        color: #93c5fd;
        box-shadow: 0 5px 14px rgba(0,0,0,0.45);
        cursor: pointer;
        transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
      }


/* Hover effekt – fényjáték */
      .card-item:hover {
        transform: translateY(-3px) scale(1.05);
        background: linear-gradient(145deg, #172135, #1e2c46);
        box-shadow: 0 8px 18px rgba(0,50,120,0.55);
      }

      /* Kattintás */
      .card-item:active {
        transform: scale(0.97);
      }



  