<div class="form-group">
    <label for="judul_<?php echo e($game?->id ?? 'baru'); ?>">Judul Game</label>
    <input id="judul_<?php echo e($game?->id ?? 'baru'); ?>" type="text" name="judul" value="<?php echo e(old('judul', $game?->judul)); ?>" placeholder="Contoh: Freaking Math" required>
    <?php $__errorArgs = ['judul'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="field-error"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>

<div class="form-group">
    <label for="deskripsi_<?php echo e($game?->id ?? 'baru'); ?>">Deskripsi</label>
    <textarea id="deskripsi_<?php echo e($game?->id ?? 'baru'); ?>" name="deskripsi" rows="3" placeholder="Deskripsi singkat game"><?php echo e(old('deskripsi', $game?->deskripsi)); ?></textarea>
    <?php $__errorArgs = ['deskripsi'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="field-error"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>

<div class="form-group">
    <label for="game_zip_<?php echo e($game?->id ?? 'baru'); ?>">Upload ZIP Game HTML <?php echo e($game ? '(opsional)' : ''); ?></label>
    <input id="game_zip_<?php echo e($game?->id ?? 'baru'); ?>" type="file" name="game_zip" accept=".zip">
    <span style="display: block; margin-top: 4px; color: var(--text-gray, #64748b); font-size: 12px; line-height: 1.4;">
        Upload ZIP berisi index.html, script.js, style.css, dan folder asset jika ada. File berbahaya seperti .php, .exe, .bat, .cmd, .sh, .ps1, dan .htaccess akan ditolak.
    </span>
    <?php $__errorArgs = ['game_zip'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="field-error"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>

<div class="form-group">
    <label for="game_url_<?php echo e($game?->id ?? 'baru'); ?>">Link / Path Game</label>
    <input id="game_url_<?php echo e($game?->id ?? 'baru'); ?>" type="text" name="game_url" value="<?php echo e(old('game_url', $game?->game_url)); ?>" placeholder="/games/game-penjumlahan/index.html atau https://...">
    <span style="display: block; margin-top: 4px; color: var(--text-gray, #64748b); font-size: 12px; line-height: 1.4;">
        Jika upload ZIP berhasil, field ini otomatis diisi path lokal seperti /games/nama-game/index.html. Link eksternal masih bisa disimpan untuk data lama, tetapi game lokal lebih disarankan.
    </span>
    <?php $__errorArgs = ['game_url'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="field-error"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>

<div class="form-grid">
    <div class="form-group">
        <label for="status_<?php echo e($game?->id ?? 'baru'); ?>">Status</label>
        <select id="status_<?php echo e($game?->id ?? 'baru'); ?>" name="status" required>
            <option value="aktif" <?php if(old('status', $game?->status ?? 'aktif') === 'aktif'): echo 'selected'; endif; ?>>Aktif</option>
            <option value="nonaktif" <?php if(old('status', $game?->status ?? 'aktif') === 'nonaktif'): echo 'selected'; endif; ?>>Nonaktif</option>
        </select>
        <?php $__errorArgs = ['status'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="field-error"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
    </div>

    <div class="form-group">
        <label for="kelas_id_<?php echo e($game?->id ?? 'baru'); ?>">Kelas</label>
        <select id="kelas_id_<?php echo e($game?->id ?? 'baru'); ?>" name="kelas_id">
            <option value="">Semua kelas</option>
            <?php $__currentLoopData = $kelas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $itemKelas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($itemKelas->id); ?>" <?php if((string) old('kelas_id', $game?->kelas_id) === (string) $itemKelas->id): echo 'selected'; endif; ?>>
                    <?php echo e($itemKelas->nama_kelas); ?>

                </option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </select>
        <?php $__errorArgs = ['kelas_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="field-error"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
    </div>
</div>

<div class="form-group">
    <label for="mata_pelajaran_id_<?php echo e($game?->id ?? 'baru'); ?>">Mata Pelajaran</label>
    <select id="mata_pelajaran_id_<?php echo e($game?->id ?? 'baru'); ?>" name="mata_pelajaran_id">
        <option value="">Umum / Semua mata pelajaran</option>
        <?php $__currentLoopData = $mataPelajaran; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mapel): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <option value="<?php echo e($mapel->id); ?>" <?php if((string) old('mata_pelajaran_id', $game?->mata_pelajaran_id) === (string) $mapel->id): echo 'selected'; endif; ?>>
                <?php echo e($mapel->nama_mapel); ?>

            </option>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </select>
    <?php $__errorArgs = ['mata_pelajaran_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <div class="field-error"><?php echo e($message); ?></div> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>

<div class="modal-footer">
    <a href="<?php echo e(route('admin.game.index')); ?>" class="btn-cancel" style="text-decoration: none;">Batal</a>
    <button type="submit" class="btn-save"><i class="fa-solid fa-check"></i> <?php echo e($submitLabel); ?></button>
</div>
<?php /**PATH C:\xampp\htdocs\elearningsd-allFitur-main\resources\views/admin/partials/game-form.blade.php ENDPATH**/ ?>